Since build 1632 theDEAL_REASON property works in the tester!
If closing on Stop loss - do not trade (wait for the next signal)
If closing on Take profit - then open another "buy" onthe next tick. Further, if closed in +, open another "buy" trade.
Please help to change the EA:
If closing on Stop loss - do not trade (wait for the next signal)
If closing on Take profit - then open another "buy" onthe next tick. Further, if closed in +, open another "buy" trade
What signal are we waiting for?
000111111
000111111 (candles)
There are no "signals" in this Expert Advisor. The direction of the position is determined randomly:
if(math_rand%1==0 && math_rand%2==0) { double sl=(InpStopLoss==0)?0.0:m_symbol.Bid()+ExtStopLoss; double tp=(InpTakeProfit==0)?0.0:m_symbol.Bid()-ExtTakeProfit; OpenSell(ExtLot,sl,tp); } else { double sl=(InpStopLoss==0)?0.0:m_symbol.Ask()-ExtStopLoss; double tp=(InpTakeProfit==0)?0.0:m_symbol.Ask()+ExtTakeProfit; OpenBuy(ExtLot,sl,tp); }
Please help to change the EA:
If closing on Stop loss - do not trade (wait for the next signal)
If closing on Take profit - then open another "buy" onthe next tick. Further, if it closed in +, open another "buy" trade.
Thank you all, got it all figured out)
Hi.
I see that the stop loss and take profit are set automatically. :)
But the expert executes positions automatically on live data. This is not what I want to achieve however. I like that the stop loss and take profit are set automatically on the execution of the position, but I want to execute positions manually. There are not such experts for MetaTrader 5 unfortunately. :( If you can add sub-pips to the code, I would be really happy ( 100 sub-pips = 10 pips ). After the manually execution of a position, nothing happens to the levels of stop loss and take profit.
I'm willing to pay you $100 if you can make this code for me. :)
I don't know which way is best to pay with, but I'm sure you can give me a solution. :D
Best regards,
Johannes Hillestad Baumann
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Stop Loss Take Profit:
If a trade is closed by Stop loss, the volume is doubled; if by Take profit the minimum volume is used. OnTradeTransaction is used to determine whether a trade was performed after the activation of Stop loss or Take profit.
Author: Vladimir Karputov