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.

 
Diamondjag

Legend
100100100100
Posts: 404

Joined: 3/12/2006
Location: Brighton, Colorado

User Profile
 
Subject : RE: Help with Programming Stops
Posted : 6/12/2018 9:54 PM
Post #30069 - In reply to #30066

Mel, or anyone else...I think I've got everything working except the stop for an entry price plus or minus ATR(5)*1.67. In other words a stop 5 ATR's times 1.67 below entry on long trades and 5 ATR's times 1.67 above entry for short trades. I've programmed this but it doesn't seem to work...the stops are too far away. Any help would be appreciated.

#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
if Signal = LongSignal then
myLevel = EntryPrice-(ATR(5)+(1.67*(ATR(5)*EntryPrice)))
elseif Signal = ShortSignal then
myLevel = EntryPrice+(ATR(5)+(1.67*(ATR(5)*EntryPrice)))
end if
end if

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

ExitLevel = myLevel 'so it will plot on chart


Deleting message 30069 : RE: Help with Programming Stops


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