Profit target and Stop loss Alert
double stop =AccountBalance()*(-Risk)/100; double profit =AccountBalance()*(Risk)/100; double floating_profit =AccountProfit(); { if(StrToDouble(floating_profit) <= stop) ...
Question 1: Why are you taking a double (floating_profit) converting it to a string (to be passed to StrToDouble) which will return the exact same doulble you started with?
Question 2: Stop is always less then zero, but floating_profit will not be, unless this trade is wiping out all profits from all previous trades. Shouldn't you be comparing to AccountEquity()-AccountBalance()
I'm not a programmer, ....
Learn
Please help with programming of EA,
or pay someone. No slaves here.
Hello,
I have a problem on my indicator that I have noted in the case of achieving Profit target and stop loss. How to modify code that notice was displayed only for a time?
For example: every 10 seconds
I tried using function : Sleep (), unfortunately without success.
Thank you for your help