Thanks.
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
Indicator with numerous parameters
Collapse
X
-
Indicator with numerous parameters
If I have written an indicator that has numerous parameters, how do I write an overide function for it that has only say 0 or 1 parameters and sets defaults for all the others, so that when a user wants to include that indicator in their code they don't have to list all the parameters every time.
Thanks.Tags: None
-
Originally posted by annettes View PostIf I have written an indicator that has numerous parameters, how do I write an overide function for it that has only say 0 or 1 parameters and sets defaults for all the others, so that when a user wants to include that indicator in their code they don't have to list all the parameters every time.
Thanks.
TJ
Comment
-
Thanks Trader.Jon. I found the indicator you were referring to, but could not find the type of code I am looking for. Thanks for putting me onto that indicator though. It looks great!
Can anyone else help with this question please. What I really need to know is where to put the code for the override.
Thanks.
Comment
-
How about an enum in the Variables section (Say, Model1, Model2, Model3), then assign the values to the variables you want using switch/break? Not sure if you would put in Initialize(), OnStartUp(), or OnBarUpdate(), though. Try it in Initialize() and see how it goes.
Comment
-
Good idea about the enum, a helpful sample is located here - http://www.ninjatrader.com/support/f...ead.php?t=3420BertrandNinjaTrader Customer Service
Comment
-
I don't think you quite understand what I am asking. I probably didn't explain it very well. I am not asking about the contents of the override function, but where to define it. The main function definition is in the part of the code generated by NinjaScript - i.e. the part we can't change. So if I want to write an alternative definition, with fewer parameters, where do I put it?
Thanks.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by CortexZenUSA, Today, 12:53 AM
|
0 responses
1 view
0 likes
|
Last Post
by CortexZenUSA
Today, 12:53 AM
|
||
Started by CortexZenUSA, Today, 12:46 AM
|
0 responses
0 views
0 likes
|
Last Post
by CortexZenUSA
Today, 12:46 AM
|
||
Started by usazencortex, Today, 12:43 AM
|
0 responses
2 views
0 likes
|
Last Post
by usazencortex
Today, 12:43 AM
|
||
Started by sidlercom80, 10-28-2023, 08:49 AM
|
168 responses
2,262 views
0 likes
|
Last Post
by sidlercom80
Today, 12:05 AM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
3 responses
10 views
0 likes
|
Last Post Yesterday, 11:58 PM |
Comment