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 6:43 AM
Post #30070 - In reply to #30069

Here ya go:

myLevel = EntryPrice-1.67*ATR(5)
elseif Signal = ShortSignal then
myLevel = EntryPrice+1.67*ATR(5)

Also correct/simplify the final if then to:

If Signal = LongSignal and C < myLevel then
Signal = ExitSignal
elseif Signal = ShortSignal and C > myLevel then
Signal = ExitSignal
end if


PS: although is legal not to in OL, when you post code on the forum the > < disappear unless you put spaces around them.

[Edited by Jim Dean on 6/13/2018 6:46 AM]

Deleting message 30070 : RE: Help with Programming Stops


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