stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Need some help please
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3333
Page 1 of 1
Author:  matty44 [ Tue Dec 17, 2013 1:15 pm ]
Post subject:  Need some help please

Hi all, I'm looking for an EA to do some very basic (in my opinion) tasks. Maybe one exists already that can do all of these, if that's the case, could someone please point me in the right direction? I'm currently using multiple EAs and some manual input to do the job, but would love to just "set it, and forget it."

Anyways, here's what I would like the EA to be able to do:

"Mandatory"
1) Place a trade everyday at a set time (for two currency pairs at the same time)
2) Set a SL and TP
3) Be able to move SL to BE at a set number of pips
4) Close the trades at a set time (if they have not already reached TP)

"Optional"
5) It would be nice to have an option to close both trades when a net amount of pips have been reached between the two trades (regardless if one has already hit its SL. I.E. Close trades if +50 combined pips. If one trade instantly hit 25 pip SL and closed itself, it would only close the other still active trade when it hit 75 pips...does that make sense? Basically a net pip amount for the day...)
6) I'd like the EA to adjust the size of my position each night to be a percentage of my total equity. I can always just set this manually each day, but, like I mentioned, with my strategy I'd like to be able to just set it and forget it.

Thanks!

Matty
Author:  fxdaytrader [ Tue Dec 17, 2013 1:25 pm ]
Post subject:  Re: Need some help please

matty44 wrote: 1) Place a trade everyday at a set time (for two currency pairs at the same time)
Just place a trade, no underlying rules (for example place trade if rsi>50)?

Most of all mptm or other ordermanager-eas should do.

Regarding the timebased SL I am not sure if it is now implemented in the manger-eas. Maybe you could use the following (to be called from the trademanager-section):

Code: Select all

void TimeBasedSL(string symbol,int magicnumber,int TimeBasedSLdays,bool TimeDesignationInDaysOrBars) {
bool result;
 for (int cnt=OrdersTotal()-1; cnt>=0; cnt--) {
  if (!OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)) continue;
  if (OrderSymbol()!=symbol) continue;
  if (OrderMagicNumber()!=magicnumber) continue;
   {   
    if (
        (TimeDesignationInDaysOrBars && (TimeCurrent() - OrderOpenTime()) >= (TimeBasedSLdays * 86400))
     || (!TimeDesignationInDaysOrBars && (TimeCurrent() - OrderOpenTime()) >= (TimeBasedSLdays * Period() * 60))
    ) {
     while(IsTradeContextBusy()) Sleep(100);
     RefreshRates();
     string sdaysorbars="days";
     if (!TimeDesignationInDaysOrBars) sdaysorbars="bars";
     
     if (OrderType()==OP_BUY) {
      result=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),9999,CLR_NONE);
      Print("TimeBasedSL(): **** BUY order ticket "+OrderTicket()+" (opentime: "+TimeToStr(OrderOpenTime())+") closed (SL="+TimeBasedSLdays+" "+sdaysorbars+")");
     }
     if (OrderType()==OP_SELL) {
      result=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),9999,CLR_NONE);
      Print("TimeBasedSL(): **** SELL order ticket "+OrderTicket()+" (opentime: "+TimeToStr(OrderOpenTime())+") closed (SL="+TimeBasedSLdays+" "+sdaysorbars+")");
     }
    }//if (TimeCurrent() - ...
   }
 }//for (int cnt=OrdersTotal()-1; cnt>=0; cnt--) {
}
Author:  matty44 [ Wed Dec 18, 2013 4:15 am ]
Post subject:  Re: Need some help please

No rules, just place a buy/sell at certain time that I set. Where could I find this mptm? I have pretty much zero coding knowledge, so unless I can drag and drop it into my Empty4 expert advisors tab, I can't really use it...

Thanks for the response.

Matty
Author:  Eddie70 [ Wed Dec 18, 2013 6:23 am ]
Post subject:  Re: Need some help please

hello all first time here i have an Ea which needs correcting the codes anyone can help on this .

thnx
Author:  phil_trade [ Wed Dec 18, 2013 7:54 am ]
Post subject:  Re: Need some help please

Eddie70 wrote:hello all first time here i have an Ea which needs correcting the codes anyone can help on this .

thnx
Hi Eddie

welcome on board !

please publish your code and explain the problem. You will find someone to help you :yahoo:

cheers

Philippe
Author:  fxdaytrader [ Wed Dec 18, 2013 9:57 am ]
Post subject:  Re: Need some help please

matty44 wrote:Where could I find this mptm?
Do you know GOOGLE (at least: NSA?) :xm:

mptm = "multi purpose trademanager", it is one of steves masterpieces :arrow:

here we go:
http://www.google.de/#q=site:stevehopwo ... m+%2B+mptm
and will land at this forum here ;)
All times are UTC Page 1 of 1