OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


Only Forum Moderators, Administrators, and the owner of this message may delete it.

 
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Help with Programming Stops
Posted : 6/13/2018 1:32 PM
Post #30072 - In reply to #30071

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 Signal = ExitSignal
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]

Deleting message 30072 : RE: Help with Programming Stops


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.