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.


  Current location        Thread information  
OmniTrader Pro Resource Forum
OmniTrader Pro Technical Support
Inserting Custom Indicators into a System or Strat
Last Activity 2/21/2018 4:06 PM
6 replies, 230 viewings

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

^ Top
Jeffrey Mishlove

Member

Posts: 14

Joined: 7/13/2011
Location: Las Vegas

User Profile
 
Subject : Inserting Custom Indicators into a System or Strat
Posted : 9/13/2017 11:32 AM
Post #29644

So far, the only way I have figured out how to do this is to take the entire code for a custom indicator and insert it into a system. I thought I had managed to do that and to compile the system successfully. However, I am not sure, as when I attempted to create a strategy with this system, different error messages showed up.

I spoke to Thad at Nirvana. He recommended inserting my custom indicators into a filter, rather than a system. While I was on the phone with him, it seemed as if that was possible. Only later did I discover that what I had assumed to be my custom indicator was really a similarly named indicator from a plugin -- and not my custom indicator at all. In fact, I still don't see how to insert a custom indicator even into a filter.

What am I missing???

[Edited by Jeffrey Mishlove on 9/13/2017 11:34 AM]

^ Top
Jim Dean

Sage
20001000100
Posts: 3108

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Inserting Custom Indicators into a System or S
Posted : 9/13/2017 11:58 AM
Post #29645 - In reply to #29644

First, two questions
1. Is the System that you tried to insert the custom indicator into an OLang System?
2. What is the purpose you have in mind for doing this? (Act as Filter, or act as Entry Sig, etc)
^ Top
Jeffrey Mishlove

Member

Posts: 14

Joined: 7/13/2011
Location: Las Vegas

User Profile
 
Subject : RE: Inserting Custom Indicators into a System or S
Posted : 9/13/2017 12:16 PM
Post #29646 - In reply to #29645

1. I was attempting to build a custom system with custom indicators using the OmniLanguage editor. (Of course, I can type in my custom indicators, but they do not show up as maroon. So, I presume OmniLanguage does not recognize them as indicators. My workaround has been to insert the entire code for the indicator into the custom system.)

2. These indicators could be used either as entry signals (as I originally intended) or as filters to confirm an entry (as Thad has suggested).

Jeff

[Edited by Jeffrey Mishlove on 9/13/2017 12:18 PM]

^ Top
Jim Dean

Sage
20001000100
Posts: 3108

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Inserting Custom Indicators into a System or S
Posted : 9/13/2017 12:36 PM
Post #29647 - In reply to #29646

OK, if you're working with "pure" OLang code rather than "canned" Systems, you can easily utilize any OLang Indicator within any OLang System, Stop, or other Indicator. I've posted about this in the TradeTight forum ... Click here ... here is a summary:

To do this:

1. make sure the Return value of the Indicator to be "called" is what you want to use in the calling routine, and that it compiles without error. Best to test it in a custom Focus List column to make sure the value is what you think it is ;~)

2. the Indicator to be called *must* reside either in the "VBA\Indicators" folder, OR if you have a dedicated folder in VBA that holds the *calling* routine, then you optionally can put the *called* indicator in that dedicated folder (always works if called Indic is in the Indicators folder).

3. when you "call" the Indicator in your shell (calling) routine, simply insert the indicator's filename, followed by open-paren, then one comma-delimited value for each param in your indicator, followed by close-paren ... that is, it works just like an internal OT canned function such as MACD(12,26) etc.
... strictly speaking you should use an empty set of paren's MyIndic() in the calling routine, if you have no #param's in your called indic, but I've found that it usually works to leave out the paren's if no param's are needed

That's it. Works great. I use this capability all the time. You can even nest them deeper ... but if you do so, you should *carefully* control execution in the called indic using "if bar >= x then" types of clauses.

There are also some fancy rules that relate to how efficient the execution is, in the Temp-file compiled code ... but that's usually not an issue unless you are writing very calc-intensive stuff (most people don't).

[Edited by Jim Dean on 9/13/2017 12:46 PM]

^ Top
Jim Dean

Sage
20001000100
Posts: 3108

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Inserting Custom Indicators into a System or S
Posted : 9/13/2017 12:48 PM
Post #29648 - In reply to #29647

If you want to use the Indicator to create an Entry Signal, then you need to:

1. Change the top line from #Indicator to #System

2. Remove any Return statements

3. Add at least one "Signal=LongSignal" and/or "Signal=ShortSignal" at the place in the code that the calc's determine an entry is appropriate. Usually there is an If/Then statement associated with this.

... it is also possible to rig up a filter block to "act like" a System that creates entries ... but it's totally unnecessary if you're using OTPro with OLang capabilities ... I've written howto's on this but they don't apply for your situation ...

[Edited by Jim Dean on 9/13/2017 12:51 PM]

^ Top
Jeffrey Mishlove

Member

Posts: 14

Joined: 7/13/2011
Location: Las Vegas

User Profile
 
Subject : RE: Inserting Custom Indicators into a System or S
Posted : 9/13/2017 1:20 PM
Post #29649 - In reply to #29648

Jim, thanks for all of your assistance. You are like the guardian angel of Nirvana Systems.

I gather that the first method you suggested does not work if I wish to use the indicators to create entry signals for a system.

I am puzzled by the fact that when I typed in the custom indicator, just as you recommended, it did not turn maroon. I am also puzzled that my custom indicators show up in a window to insert into Focus List columns, but are not available in the window to insert into a custom OmniLanguage system.

I think that the second method you have proposed is, essentially, identical to the workaround that I referred to in my original post. (I have connected three custom indicators using the AND operator to create a long entry signal.)

Jeff

[Edited by Jeffrey Mishlove on 9/13/2017 1:21 PM]

^ Top
Jim Dean

Sage
20001000100
Posts: 3108

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Inserting Custom Indicators into a System or S
Posted : 9/13/2017 2:12 PM
Post #29650 - In reply to #29649

I don't know what you mean by two different methods. Please review the link I provided to TT forum postings about this ... there are many code examples for all kinds of things on that forum. Re your "worries":

a. the color of the called custom indicator in the OLang editor should NOT change
b. that indicator will NOT appear in the dropdown lookup lists on the right side of the OLang or Formula Builder panes
c. that indicator, if there are ZERO compile errors, will definitely appear in the list that the focus-list "Add Custom Indicator" option pane provides.

I've done this stuff literally thousands of of times ... far more complex than what you are attempting. It works great. Give it a try ... you'll be happy to have mastered it!

And, once all that is done, and you get all excited about calling your own custom indicators a whole lot of different ways, then (not before), read the comments in this thread

[Edited by Jim Dean on 9/13/2017 2:36 PM]

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.