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.

 
Matthew Greenslet

Idol
2000252525
Posts: 2077

Joined: 2/27/2006

User Profile
 
Subject : RE: Two Bar Trailing Stop
Posted : 6/4/2007 9:53 AM
Post #5139 - In reply to #5126

#Stop
#Param "Periods", 2
Dim myLevel As Single

myLevel = myLevel[1]

If Signal = LongSignal Then
If myLevel = 0 Or LLV(Periods) > myLevel Then
myLevel = LLV(Periods)
End If
ElseIf Signal = ShortSignal Then
If myLevel = 0 Or HHV(Periods) < myLevel Then
myLevel = HHV(Periods)
End If
End If

ExitLevel = myLevel

If Signal = LongSignal and C < myLevel Then
Signal = ExitSignal
Else If Signal = ShortSignal and C > myLevel Then
Signal = ExitSignal
End If


[Edited by Matthew Greenslet on 6/4/2007 10:08 AM]

Deleting message 5139 : RE: Two Bar Trailing Stop


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