Hi
Probably the list of trades is not yet updated after opening - try to add SL and TP prices directly with the open order request.
I see you use somelbrary here for trades - but assume those 0.0s n the Sell/Buy functions may be sl/tp levels. So calculate them first:
double takeProfit = ask- TakeProfitAmount*_Point; double stopLoss = ask + StopLossAmount *_Point; and then: trade.Buy(LotSize, _Symbol, ask, stopLoss, takeProfit)
If you have problems with coding on your own, you probably get better results when you find some freelancer to code the strategy for you.
Best Regards
ulong ticket = trade.ResultDeal();
ResultDeal returns the ticket very late... Use this instead: ulong ticket = PositionGetTicket(PositionsTotal()-1);

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
I need some help with this EA don't add SL and TP on live trading but when i use it on strategy tester it works normal
sorry if the code is missy I'm just using chatgpt for this
the mean EA concept is to open buy and sell position at every new candle Open.
Thanks