Can a plot value generated in an indicator be exposed to a strategy the same way as a custom data series? Please advise. Thank you.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Exposing Plot Values to Strategies
Collapse
X
-
Ryan M.NinjaTrader Customer Service
-
Ryan M.NinjaTrader Customer Service
Comment
-
Hi Ryan,
So I followed the suggestions and am getting compilation errors in my strategy.
1. Intellisense tells me I can overload my custom indicator and provide only 4 parameter values yet the compiler objects saying that no overload with 4 parameters exists.
2. My indicator has 4 plots in it and the strategy compiler complains thatthe first plot does not exist in the current context.
Any suggestion would be greatly appreciated. Thank you.
Comment
-
I'm not sure. If you can attach the script here will give a look. You can also consider building your expression in the condition builder to see the syntax used. This also has an option to set plot on chart = true so you can see the syntax for the Add() statement in Initilize().Ryan M.NinjaTrader Customer Service
Comment
-
Thanks Ryan. Using the condition builder did the trick. It turns out that when all the parameters are included the strategy compiles correctly.
One final question, however:
I have multiple plots in the indicator and a number of parameters. I tried reassigning the indicator with the parameters as follows:
double TUp = PB_Tup(par1, par2, par3, ...)
then I wanted to use
TUp.Plot1Name[0]
but the compiler complains it cannot convert the types. Any suggestions?Last edited by Zeos6; 06-15-2011, 01:41 PM.
Comment
-
Originally posted by Zeos6 View PostHi Ryan,
So I followed the suggestions and am getting compilation errors in my strategy.
1. Intellisense tells me I can overload my custom indicator and provide only 4 parameter values yet the compiler objects saying that no overload with 4 parameters exists.
2. My indicator has 4 plots in it and the strategy compiler complains thatthe first plot does not exist in the current context.
Any suggestion would be greatly appreciated. Thank you.
Comment
-
Thanks Ryan. I have this issue resolved now. I inadvertently created a namespace to hold my public enums that was named PB_TUp.PublicEnums and that was the source of the conflict. Thank you very much for all your help.
One follow up question. The plots can be teted if they contain a valid plotable value using the .ContainsValue() method. This does not carry over to the strategy. Should I be using Reset() to set the plot values to null and then checking for null in my strategy? Please advise. Thank you.Last edited by Zeos6; 06-15-2011, 03:23 PM.
Comment
-
Hello, I think you can do this and expose indicator plot values you garner from a specific strategy. I am not sure though how it would look like in the syntax level. You can try using condition builder if you can't do it with anything else. You will also be required to plug in all the necessary parameters in order for it to compile correctly.
Comment
-
Hi cedricf,
I appreciate you attempting to answer this question but you are missing the point of the question. Of course you can expose the plot values in a strategy. That is not the issue here. The real issue is that unless a plot value is actually set in your indicator, it contains a place holder equivalent to the close of the bar, and you can test for valid values of the Plot using the .ContainsValue() method in your indicator.
The issue here is...
When Plot values are exposed in a strategy, what value is being eposed when a values has not been explicitly set in the indicator? Will the value exposed be the place holder value or will I get a null or 0?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Rapine Heihei, Today, 08:19 PM
|
1 response
8 views
0 likes
|
Last Post Today, 08:30 PM | ||
Started by Rapine Heihei, Today, 08:25 PM
|
0 responses
6 views
0 likes
|
Last Post Today, 08:25 PM | ||
Started by f.saeidi, Today, 08:01 PM
|
1 response
9 views
0 likes
|
Last Post Today, 08:17 PM | ||
Change colour of Stop market and limit orders to red and green via indicator script
by Rapine Heihei
Started by Rapine Heihei, Today, 07:51 PM
|
0 responses
8 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by frslvr, 04-11-2024, 07:26 AM
|
5 responses
98 views
1 like
|
Last Post
by caryc123
Today, 07:47 PM
|
Comment