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.

 
Gordon

Member

Posts: 22

Joined: 4/9/2008
Location: Fort Washington, PA

User Profile
 
Subject : RE: Is SDK still available/usable?
Posted : 2/3/2019 4:01 PM
Post #30280 - In reply to #30279

Hi Jim,

Thanks again. I should have taken a closer look. Even though you declare simple types, they're still treated like arrays. IN this indicator, nCount is a "single", but you can reference it's previous values. So this should be very doable! I'll post the results of what I code.

Dim nCount As Single

If C <= C[1] Then ' If we close below yesterday's bar
nCount = nCount[1] + 1 ' Then use the count of yesterday, and increment it by one
Else
nCount = 0 ' Otherwise reset it to zero
End If

Plot("Count", nCount) ' Create a full plot
Return nCount ' Return the calculated value, so it can be used in a filter block
Deleting message 30280 : RE: Is SDK still available/usable?


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