Hello try this
double ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK); bool check=order.Buy(0.1,Symbol(),ask,0,0,NULL); ulong ticket=order.ResultOrder(); Print("Order Ticket : "+ticket); //change stops double sl=ask-500*Point(); double tp=ask+1000*Point(); bool modi=order.PositionModify(ticket,sl,tp);
Lorentzos Roussos:
Hello try this
Thank you so much for your answer... I just have a simple problem. When I compile the code there is an error
: 'order' - undeclared identifier SimpleBuyTrade.mq5 7 15
Do you know what is the problem?
Thank you so much for your help. It's working now
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 everyone,
Sorry to bother you for that but I am a beginner and I do not understand why my EA doe not work. I mean that the code is working but when I do a back-test, it seems that the EA doesn't enter in the market.
Could you maybe help me?
Best regards.
Stefan Hanssen