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.


This message cannot be deleted. It is the first message of the thread.
Administrators or moderators may choose to delete the entire thread


 
Duxx

Elite
500100100100252525
Posts: 881

Joined: 2/18/2009

User Profile
 
Subject : Help on Olang - System
Posted : 8/25/2010 10:31 PM
Post #16874

Hi

Im trying to set up a system and an indicator.

I want

To capture a lower low from prior bar I have the following:

L[1] < L[2] and L > L[1]

Then, I want to fire a long if the Close is above the high of the lowest low captured above as follows:

C > H[1]

But the issue is that life is not perfect and the current bar close may not be higher than the high of the lowest low, so I have the following:

# Param "NBars",5,1,10

Dim xCount, yCount, zCount As Single

if L[1] < L[2] and L > L[1] then

xCount = 1 'records the fact that the conditons above have been met
end if

if xCount = 1 and C > O and C > H[1] then 'sets next test condition
yCount = 1 'records the conditions here met
else yCount = 0
end if

if xCount = 1 then
zCount = zCount[1] + 1 'causes a count up of the number of bars passed since the first condition was met
'else If xCount = 0 then
'zCount = 0
end if

if yCount = 1 then
signal = longsignal
End if

If zCount = NBars or yCount = 1 then
xCount = 0
yCount = 0
zCount = 0
end if


But the above does not work precisely as described and Im not sure how to apply the same process for a short (which is the inverse)

Any ideas are welcome

Thanks

[Edited by Duxx on 8/25/2010 10:41 PM]

Deleting message 16874 : Help on Olang - System


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