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.

 
rob-McKinneyTexas

Veteran
100
Posts: 111

Joined: 6/16/2006
Location: San Antonio

User Profile
 
Subject : RE: Two Bar Trailing Stop
Posted : 6/3/2007 8:54 PM
Post #5133 - In reply to #5126

Hi guys,

Kris... I see you check to see whether you need the last value of mylevel, or whether it's being replaced. So you save mylevel = mylevel[1] until the other if/then/else checks are done. By the way, guess you know you're not using exitlevel for anything.

I always clear out the stop level once the exit is issued in stops like this.... not sure it makes sense but that stop level may persist into the next trade. So the second time a stock trades, mylevel[1] will still be the last stop level instead of zero. I would change the end to look like this:

If Signal = LongSignal and C < myLevel Then
mylevel = 0
Signal = ExitSignal
ElseIf Signal = ShortSignal and C > myLevel Then
mylevel = 0
Signal = ExitSignal
end if

I didn't check it but it might help. Good luck!

Rob





[Edited by rob-McKinneyTexas on 6/3/2007 8:56 PM]

Deleting message 5133 : RE: Two Bar Trailing Stop


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