Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Hi sorry I was unclear. I was providing snippets not complete code. Here is the complete version: #Stop 'CSG FIB ATR Stop '1.67 time ATR(5) from Entry dim myLevel as single if myLevel = 0 then 'this must be first bar of the trade if myLevel=0 'set the fixed level myLevel = EntryPrice-1.67*ATR(5) elseif Signal = ShortSignal then myLevel = EntryPrice+1.67*ATR(5) end if end if If Signal = LongSignal and C elseif Signal = ShortSignal and C>myLevel then Signal = ExitSignal end if Exitlevel = myLevel 'so it will plot on chart PS - I normally use a plotprice command instead of the last line. [Edited by Jim Dean on 6/13/2018 1:34 PM] |