ATR STOP NOT WORKING

• This topic has 2 replies, 2 voices, and was last updated 5 months ago by JS.
Viewing 3 posts - 1 through 3 (of 3 total)
• #231523

WHAT APPEARS TO BE WRONG WITH THIS CODE NOT WORKING? THANKS FOR THE HELP
// Calculate the Average True Range (ATR)
ATR_Length = 14
ATR = AverageTrueRange(ATR_Length)

indicator1 = supertrend[Multiplier, Length]

if close crosses over indicator1 then
endif

if close crosses under indicator1 then
sellshort at market
endif

set target pprofit 50
set target pprofit 12 // Profit target of 12 points

// Set stop loss at 1.5 times ATR
ATR_Value = valuewhen(1, ATR)
SET STOP PTRAILING TRAILING Ptrailing ATR_Value * 1.5

#231535

Hi,

ATR-Length => ATRLength

SellShort at Market => SellShort x contract at Market

ATRValue=valuewhen(1,ATR) => this is no PRT code…???

SET STOP PTRAILING TRAILING Ptrailing ATR_Value * 1.5 => Set Stop PTrailing x

(x = atr * 1.5)

#231536

ATR = AverageTrueRange(ATR_Length) => ATR=AverageTrueRange[ATRLength](Close)

Viewing 3 posts - 1 through 3 (of 3 total)