For such a small amount of code, please use the SRC button and paste your code into your post
I have done it for you this time
double sl=//Calculate your stoploss here int ticket=OrderSend(Symbol(),OP_BUYSTOP,1.0,alt_ask+5*Point,3,sl,0,"expert comment",255,0,CLR_NONE);
calculate your stoploss the same as you would when placing a manual order
- You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
- Account Balance * percent = RISK = |OrderOpenPrice - OrderStopLoss| * OrderLots * DeltaPerlot (Note OOP-OSL includes the SPREAD)
- Do NOT use TickValue by itself - DeltaPerlot
- You must normalize lots properly and check against min and max.
- You must also check FreeMargin to avoid stop out
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 guys! I´m asking you for little help :) I´am newbie in MQL4 and have issue with my simply code for trading on Oil. It just open two position and i need SL always 10 cents for both position. Can anyone please advise me with this trivial issue? Or show example of code? I was spending a lot of time with that and couldn´t find any solve...thank you for everything :)