Hello, Some help needed on the code below. The EA gives me a different stop loss on each trade yet i want to be fixed at 10pips for the 1hr timeframe. I dont know if it's the sleep function causing it or it's something else.
- Needs Help in coding.
- Please NEED HELP for coding!!
- Can someone help me fix this code?
You buy at Ask and Sell at Bid and you exit a buy at Bid and exit a sell at Ask.
So may be this solves the problem?
{Alert("BUY"); Ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,2,Bid-SL*Point,Bid+TP*Point);} else if (decision==2) {Alert("SELL"); Ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,2,Ask+SL*Point,Ask-TP*Point);}BTW mql4/mt4 questions belong the the thread at the bottom just for mt4/mql4!
Carl Schreiber:
You buy at Ask and Sell at Bid and you exit a buy at Bid and exit a sell at Ask.
So may be this solves the problem?
BTW mql4/mt4 questions belong the the thread at the bottom just for mt4/mql4!Alright, thanks for this correction. Another issue am having is whenever i restart mT4, the EA restarts and open a position, yet i want it to only opne positions at the hour change. How can i sort that one
EAs must be coded to recover. If the power
fails, OS crashes, terminal or chart is accidentally closed, on the next tick,
any static/global ticket variables will have been lost. You will have an open
order but don't know it, so the EA will never try to close it, trail SL, etc. How are you going to recover? Use a OrderSelect loop to recover, or persistent storage
(GV+flush or
files) of ticket numbers
required.
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