very rough...
orderselect history: latest order: if(ordertype() == OP_BUY) if(ordercloseprice() == orderStoploss()) open short if(ordertype() == OP_SELL) if(ordercloseprice() == orderStoploss()) open longhope this gives you some ideas atleast
int ReturnTypeOfLastOrderClosed() { int i=OrdersHistoryTotal()-1; //---- OrderSelect(i,SELECT_BY_POS,MODE_HISTORY); { int OT = OrderType(); } return (OT); }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi Guys,
I can program EAs a little bit, so I copy and paste what I need and adjust it to match my requriments.
But there is one thing I could not find. I want an EA that is always in the market and only changes from long to short (or the other way) when a trailing stop is hit.
Can you give me a rough sketch how this has to be programed or do you maybe know an EA what has that?
Thanks, Sebastian