Hello to all,
I have a trailing stop ATR based and would like to modify it
(Lowering the ATR) multiplier to get out earlier if you turn when i’m in profit
to avoid going in loss.
Could you tell me how to do it, please, to find out if I’m in profit and how much euro?
This is the trailing stop code:
//default parameter values:
//ATRmoltiplicatore=1.9
//ATRperiodo=5
myhigh = highest[3](high) - ATRmoltiplicatore*(AverageTrueRange[ATRperiodo](close))
IF (mytot > low) THEN
myx = 0
ELSE
myx = myx + 0.03
ENDIF
myextra = (myx[1])*(AverageTrueRange[ATRperiodo](close))
mytot = myhigh + myextra
RETURN mytot
thanks
You can calculate the actual position profit by making the difference between the open price of a position with TRADEPRICE and the actual close.
Then, multiply this difference with the point value of the instrument : POINTVALUE
And you’ll get the profit of the current position, but without fees of course
Do you have an example? because I create a code that is the same….but it doesn’t work….