-
double ATR = iATR(NULL, 0, ATR_Period, 0);
If the ATR on the EURUSD is 100 PIPs you read 0.0100º -
tStopLoss = NormalizeDouble(Bid-atr*pt,Digits);
and that value multiplied by 0.0001º is nothing. -
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Please let me ask for some helps because I have tried many times .It is not in good condition .Still error.So I decide to get some help.
Here is trade condition
I use stop pending orders and set some stop loss .This is very close.
here picture of trade condition.
here open sell stop condition as sell position.
This sell orders has stop loss as shown in red line.
I tried to put order modify function
Here is my condition for modify SL.
if(OrderType() == OP_SELL)
// 0.32172 < 0.32477 - 5 = 0.3242
if (Bid < NormalizeDouble(OrderOpenPrice()-TrailingStart*pt,Digits))
in sell condition , if Bid (0.32172) less than open price - trailingstartpoint (5) and answer is 0.3242
This mean if current bid less than open price+traingstart ,need to modify exsiting Stop Loss .
here is custom function whole body
I use atr value in argument and I will call ATR
Show error 130 .this mean invalid sl.
So Please help me What need to edit in my codes.
I need help from expert seniors.
Thanks All.