E
Make a copy of the MT4 'Moving Average' sample EA, add extern variables for SL & TP then add them to the OrderSend line, e.g.
ticket=OrderSend(strSymbol,OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,
strComment,iMagic,0,Green);
and
ticket=OrderSend(strSymbol,OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,
strComment,iMagic,0,Red);
IIRC, there is a Trailing Stop code example in the MACD Sample EA
Good luck :)
BB
It is just a simple template.
You need to add your code/indicators for your strategy.
In the code base there are many more samples.
E
Make a copy of the MT4 'Moving Average' sample EA, add extern variables for SL & TP then add them to the OrderSend line, e.g.
ticket=OrderSend(strSymbol,OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,
strComment,iMagic,0,Green);
and
ticket=OrderSend(strSymbol,OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,
strComment,iMagic,0,Red);
IIRC, there is a Trailing Stop code example in the MACD Sample EA
Good luck :)
BB
Hi, i tried this with the MACD Sample but it did not work, guess i made a mistake so, do you have the EA for the MACD sample with stoploss?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Where to find this simple EA with more features?
Thanks.