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: Help on Olang - System
Posted : 8/26/2010 11:21 AM
Post #16890 - In reply to #16879

Duxx,

What you can do is define your "pattern" formation in a single boolean statement (occuring if = true) and use a single counter, you dont need 3. If true you reset the counter, Else increase the counter by 1. This will keep track of how many bars have passed since the most recent pattern formed.

After your pattern has formed you would then check your trigger condition if the counter is less than or equal to your parameter threshold. I.E.


#System
#PARAM "NBars", 5, 1, 10

Dim nBarsSincePattern as Integer

If L[1] < L[2] And L > L[1] Then
nBarsSincePattern = 0
Else
nBarsSincePattern += 1
End If

If nBarsSincePattern <= NBars Then
If C > O and C > H[nBarsSincePattern + 1] Then Signal = LongSignal
End If

p.s. - I edited your top post to correct the missing comparison signs. The issue is with the spacing between the < and > signs. You must have a whitespace to both the right and left of it or it is treated as HTML.
Deleting message 16890 : RE: Help on Olang - System


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