OmniTrader Forum OmniTrader 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.


  Current location        Thread information  
OmniTrader 2016 Forums
OmniTrader 2018 General Discussion
OmniLanguage questions
Last Activity 10/25/2018 4:20 AM
5 replies, 351 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
kmcintyre

Legend
100100100
Posts: 304

Joined: 8/30/2007
Location: Valley Center, CA

User Profile
 
Subject : OmniLanguage questions
Posted : 4/24/2018 10:11 PM
Post #44552

I'm used to programming in languages where I have full access to the elements of an array.

In Omni language I have access to the current bars data element, and elements of previous bars via square bracket indices.

In Omni language, at least at my novice level of knowledge, it appears that I have no idea
how many bars of data exist, how many bars of data precede the bar I'm currently looking at,
how many bars follow the current bar, etc.

In other words, I'm lost in the labyrinth of data.

There must be some tricks to work around this.

Here's an example of one thing I'd like to do.

Keep track of the lowest low that occurs each time the stochastic is below 50.
Then be able to retrieve the bar where that low occurred for each time the stochastic was below 50.
Then determine the bars between each low, and calculate the average number of bars between lows.

I'm guessing the approach I'll have to take is to Dim a number of single arrays,
use one to keep track of the start and stop bars for when stochastics is below 50,
use another one to keep track of the lowest low value for each excursion,
use another one to keep track of the bar number as an offset from the first array,
use another to track the bars between the lowest lows,
and perhaps another to hold the average. (Because declaring a single actually declares a full array.)

This all seems very cumbersome.

So here's a few questions –
1) can I use negative indexes to access data more current than the current bar?
2) is there a way to get an absolute bar number?
3) is there a way to declare a data element without it being an array?
4) is there a way to askLLV to process a range of bars?
5) do I have to worry about using an index that is greater in the number of elements that exist?
6) is my indicator function called for each bar starting from the oldest to the newest?

I'm sure I'll have a lot more questions, but these will certainly help me understand
the art of programming in Omni language.

Thanks for any assistance.

^ Top
Jim Dean

Idol
2000500100100100100
Posts: 2903

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: OmniLanguage questions
Posted : 4/25/2018 6:16 AM
Post #44553 - In reply to #44552

1) no negative indexes. OLang is designed specifically to prevent looking into the future.

2) the current bar# is stored in the reserved word “Bar”. First loaded bar is 0. Last loaded bar# is Numrec-1

3) all data elements are “hidden” arrays that automatically refresh their values from one bar to the next (unless you explicitly reassign them). So, if you “dim X as integer = 5” and then you never reassign X, it will act like a constant with a value of 5.

4) not sure what you mean. LLV always processes a range of bars. LLV(C,20) finds the lowest Close in the past “range” of 20 bars.

5) if by index you mean a [N] barsago pointer, hmmm. I don’t think it’s a problem. On any given bar, the farthest you can look back is X[Bar] … ref #2 answer.

6) The complete answer to this is sort of complex. The simple answer is, if you reference a function in a formula, either canned or custom, OLang will eval that function based on the bar# the outer hidden loop is currently at. So the answer is essentially, “yes”. There are nuances about efficiency that are too lengthy to describe here.

If you already are a VB programmer, then you can learn a lot by examine the VBA\Temp\yourindicname.txt file. That is the output of the OLang Parser which is sent to Framework for compilation, within the SDK environment.

(Addditonal info re Pro features is in the OmniTrader Pro forum. Lots and LOTS more info about using OLang is found in my forum TradeTight.org)

[Edited by Jim Dean on 4/25/2018 6:19 AM]

^ Top
kmcintyre

Legend
100100100
Posts: 304

Joined: 8/30/2007
Location: Valley Center, CA

User Profile
 
Subject : RE: OmniLanguage questions
Posted : 4/27/2018 8:07 PM
Post #44555 - In reply to #44552

Jim,

Just saw this. Thanks. Very helpful.

Is there a better reference than the OTPro manual for OL functions and programming examples/issues?

Is there any way to annotate a chart from OL? Like adding text associated a specific bar? I'd like to add cycle and wave counts to the price chart, but could see other cases where adding a letter or glyph to a indicator pane would be useful.

Keith

^ Top
Jim Dean

Idol
2000500100100100100
Posts: 2903

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: OmniLanguage questions
Posted : 4/27/2018 8:57 PM
Post #44556 - In reply to #44555

OLang can only plot curves, draw lines, and plot histograms. No letters etc.

No other written reference materials from Nirvana. But the TradeTight.org forum has a *lot*. OLang custom code, and other OT customization work, is its primary focus.
^ Top
Jim Dean

Idol
2000500100100100100
Posts: 2903

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: OmniLanguage questions
Posted : 4/28/2018 12:59 PM
Post #44557 - In reply to #44556

Argh!

At 5am this morning, the TradeTight server was hit by a bitcoin ransom virus.

I’m restoring from a full-mirror Jan 2018 backup now - hopefully that will work. Not many posts of significance since then - but if it works then a full decade of info and Q/A etc will be available.

Will let you know.
^ Top
kmcintyre

Legend
100100100
Posts: 304

Joined: 8/30/2007
Location: Valley Center, CA

User Profile
 
Subject : RE: OmniLanguage questions
Posted : 4/29/2018 8:59 AM
Post #44562 - In reply to #44552

Hope it goes well.

Please post when the site is available.

Cheers

Keith

Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


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