Current location | Thread information | |
![]() ![]() ![]() ![]() ![]() ![]() |
Last Activity 10/5/2024 12:51 AM 11 replies, 4738 viewings |
|
|
Printer friendly version |
^ Top | |||
Gordon![]() Member Posts: 22 Joined: 4/9/2008 Location: Fort Washington, PA ![]() |
Hi, I was looking to create an indicator using OmniLanguage, however, I noticed it does not support Math.Log(). My next thought was to use the SDK. I have not looked at the SDK in at least a few years. Will indicators written using the SDK work with OT2019, and, has it been recently updated? Thanks. - Gordon | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
The SDK interface ... ie the programmer-API ... technically is "updated" every time a new major (ie annual) version of OT is released. That is, all DLL's created within the SDK have to be recompiled each time it changes. Nirvana never has and probably never will formally document all the "hooks" (ie objects, classes, etc) that a VB.net programmer can use when interfacing with the SDK. They provided some examples of Indicator, System and Stop in the standard SDK package a long time ago. To my knowledge, those examples still are the same. They don't tell us about new "hooks" that are available. I use the SDK interface regularly ... just did so a few weeks ago in fact. It still works just fine and dandy. My rule of thumb is to limit myself to using things that work in OLang ... that way I can develop in that language, and readily compare to the SDK clone. But most people use the SDK in order to do tasks that OLang doesn't permit. [Edited by Jim Dean on 2/3/2019 12:40 PM] | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
OLang does support: "Log(x)" ... which is the natural log of x "Log10(x)" ... the base-10 log of x I never use natural log, but I use Log10 occasionally. You don't need to type "math.", since when you type "log10", it turns red in the editor to flag the fact that the parser recognizes it. | ||
^ Top | |||
Gordon![]() Member Posts: 22 Joined: 4/9/2008 Location: Fort Washington, PA ![]() |
Fantastic, Jim. Thanks for letting me know. I appreciate your quick responses. Btw, I had a couple of follow-on thoughts - one was that in OLang, the indicator I want to write (LaGuerre RSI) depends on values in arrays used during the calculation. The only indicators I could find only had datatypes of single, double, etc. No arrays. Do you happen to know how to declare arrays that naturally will align with price arrays (have the same number of elements, etc).? The other was that I saw you mentioned VB.Net. Is the SDK updated to NB.Net? As of the last time I used it, it was still VB6-based. The current web page suggests it still is, but it might be out of date. Thanks again, Jim. | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
SDK is VB.Net ... all OLang and OScript formulae go thru the parser to create dotNet code, then that code is compiled via Windows FrameWork ... which is dotNet. You cannot declare arrays in OLang ... all dim'd variables are "implicitly" 1-dim arrays, driven by the bar # ... the parser takes care of that. Here is a link that shows how to calc that RSI without arrays ... at least according to TASC: https://www.metastock.com/customer/resources/tasc/?id=43 [Edited by Jim Dean on 2/3/2019 3:25 PM] | ||
^ Top | |||
Gordon![]() Member Posts: 22 Joined: 4/9/2008 Location: Fort Washington, PA ![]() |
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 | ||
^ Top | |||
Gordon![]() Member Posts: 22 Joined: 4/9/2008 Location: Fort Washington, PA ![]() |
Hi Jim, Are you aware of more robust OLang examples and/or documentation? I find myself scratching my head at every turn :) For instance, I want to sum the last n values of something, but the documentation doesn't indicate how many arguments the SUM function takes, etc. Kind of the same for MAX - does it return the MAX for a price array, or two values, etc.? I'm thinking of just writing a FOR...NEXT loop for the SUM function - but I'm not even sure how to do that. Any thoughts you or anyone might have would be great. Thanks. Gordon | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Hi Gordon More robust OLang examples, you ask? Heh heh - that’s what I created the TradeTight.org forum for, over a dozen years ago :-) Enjoy! | ||
^ Top | |||
Gordon![]() Member Posts: 22 Joined: 4/9/2008 Location: Fort Washington, PA ![]() |
Hi Jim, TradeTight looks like a fantastic site - I sent you an email with the requested information. Meanwhile, I stumbled through creating the Laguerre RSI indicator. I have a For loop in it that I'm not sure is necessary. Once I figure that out, I'll post the results - someone might find it useful. - Gordon | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Got your email and got you registered in TradeTight :~) I doubt that a for-next is needed for the algorithm at the link I posted. Just three variables for the prior bars' values. Then, at the end of your code after the calcs for the current bar, just "increment" them so that the next bar in the outer implicit (parser) loop has updated "lookbacks" ... parameters ... declarations ... calculations ... Var3Bago = Var2Bago Var2Bago = Var1Bago Var1Bago = VarThisB return | ||
^ Top | |||
Gordon![]() Member Posts: 22 Joined: 4/9/2008 Location: Fort Washington, PA ![]() |
Hi Jim, I've already learned from TradeTight - thank you for getting me registered. I have the indicator working, my next step is to figure out how to base a stop and a target on values (low and high of BBand) as of when the long signal fired. The journey continues! Regards, Gordon | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
You're very welcome! I'm not allowed to "advertise" TT on N forums, so I'm sorry that you hadn't known about it sooner. Glad to have you aboard! |
|
|
Legend | Action | Notification | |||
Administrator
Forum Moderator |
Registered User
Unregistered User |
![]() |
Toggle e-mail notification |