I am not sure this issue is proper here, or in SQ X programing.
The trailing stop in SQ X with atr is
Close ± N * ATR (Multicharts code)
Please add new some exit typee.
1, It's like this. In long position, I want the trailing stop is always the highest value, and in the short position, the trailing stop is always the lowest one.
// EL code
LongTrailingStop = close - N*ATR;
if LongTrailingStop < LongTrailingStop[1] then // in longpostion, the trailing stop is always the highest value
LongTrailingStop = LongTrailingStop [1]
Like the picture below.
2, And is it possible that allow us to choose the price for tracking? I want to use high when in long position, and low in short postion.
if marketposition = 1 then begin
LongTrailingStop = High - N* ATR;
end;
if marketposition=-1 then begin
ShortTrailingStop = Low + N*ATR;
end;
3, Maybe it's allowed using average of standard deviation, or bar range instead of ATR value in trailing stop or stop loss.
Description changed:
I am not sure this issue is proper here, or in SQ X programing.
The trailing stop in SQ X with atr is
Close ± N * ATR (Multicharts code)
Please add new some exit typee.
1, It's like this. In long position, I want the trailing stop is always the highest value, and in the short position, the trailing stop is always the lowest one.
// EL code
LongTrailingStop = close - N*ATR;
if LongTrailingStop < LongTrailingStop[1] then // in longpostion, the trailing stop is always the highest value
LongTrailingStop = LongTrailingStop [1]
Like the picture below.
2, And is it possible that allow us to choose the price for tracking? I want to use high when in long position, and low in short postion.
if marketposition = 1 then begin
LongTrailingStop = High - N* ATR;
end;
if marketposition=-1 then begin
ShortTrailingStop = Low + N*ATR;
end;
3, Maybe it's allowed using average of standard deviation, or bar range instead of ATR value in trailing stop or stop loss.