Casey Courtney:
CopyBuffer(handleATR,0,1,1,atrValue);
CopyBuffer(handleATR,0,1,1,atrValue);
Generally you should check returned value of CopyBuffer. There may be errors during execution of this function, although in your case it only affects the comment value but in other cases it could be catastrophic.
Casey Courtney:
if(posSL != posOpenPrice
if(posSL != posOpenPrice
Comparing two doubles is not something that works always... I prefer to do it this way:
if(MathAbs(posSL-posOpenPrice)>2*_Point ...
Yashar Seyyedin #:
Generally you should check returned value of CopyBuffer. There may be errors during execution of this function, although in your case it only affects the comment value but in other cases it could be catastrophic.
Comparing two doubles is not something that works always... I prefer to do it this way:
Thanks I'll add that stuff in. I'll add multisymbol capability too, shouldn't be that hard

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
The reason I am posting this here is because I want to know what the rest of you (especially the moderators) think I should add for error checking. Currently I know problems will occur if the trade doesn't have a stoploss and I also want to add error checking for if the trigger for the breakeven is > than the trigger for the trailing stop then it might do weird things. Also its not multisymbol yet so I will eventually add that capability.