NexusFi: Find Your Edge


Home Menu

 





Exposing indicator settings that is used in a strategy


Discussion in NinjaTrader

Updated
    1. trending_up 1,486 views
    2. thumb_up 2 thanks given
    3. group 1 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Exposing indicator settings that is used in a strategy

  #1 (permalink)
 KhaosTrader 
San Jose
 
Experience: Intermediate
Platform: NinjaTrader, Esignal
Trading: Stocks
Posts: 107 since Jan 2012
Thanks Given: 40
Thanks Received: 21

I have a custom indicator I wrote with about 20 or so parameters. I want to make a strategy using that indicator, but I really dont want to have to write all the indicator getter ans setter paramater code again in the strategy -- Is it possible to expose the parameter settings of the indicator automatically in the strategy? or must I code and write all the indicator parameter getter and setter codes in the strategy again, and map it to the indicator in my strategy?

Thank you in advance.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #3 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425



KhaosTrader View Post
I have a custom indicator I wrote with about 20 or so parameters. I want to make a strategy using that indicator, but I really dont want to have to write all the indicator getter ans setter paramater code again in the strategy -- Is it possible to expose the parameter settings of the indicator automatically in the strategy? or must I code and write all the indicator parameter getter and setter codes in the strategy again, and map it to the indicator in my strategy?

Thank you in advance.

As far as I know it's a sad copy/paste job or convert the indicator into a strategy.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 KhaosTrader 
San Jose
 
Experience: Intermediate
Platform: NinjaTrader, Esignal
Trading: Stocks
Posts: 107 since Jan 2012
Thanks Given: 40
Thanks Received: 21

Ok, can we use named parameters? I cant get them to work it seems, for ninjascript , as we are not using the new keyword, just assigning, the indicator... unfortunately, it looks like i am forced to go through the list of each parameter, in perfect sequence. If I make an error, or update my indicator, things can break without me knowing...

If there were defaults or named parameters that I could get to work, that would be great. If anyone has suggestions please let me know..

Thank you.

Started this thread Reply With Quote
  #5 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


KhaosTrader View Post
Ok, can we use named parameters? I cant get them to work it seems, for ninjascript , as we are not using the new keyword, just assigning, the indicator... unfortunately, it looks like i am forced to go through the list of each parameter, in perfect sequence. If I make an error, or update my indicator, things can break without me knowing...

If there were defaults or named parameters that I could get to work, that would be great. If anyone has suggestions please let me know..

Thank you.

You can just call the indicator from your strategy passing in named parameters from variables that you expose in your strategy Parameter section.

e.g. if (RSI(myPeriod, mySmooth)[0] is something) blah, blah

Where myPeriod and mySmooth are variables declared in your strategy and exposed in the strat's parameter section as usual, so then the order is irrelevant, and not all of them need to be exposed.

The compiler will stop anything breaking without you realising as Ninja always recompiles all user indicators and strats when any code change is made and F5 is hit. Yes, it is that fast.

Cheers

ps it's a Saturday and it's been a long time since I did any strategy stuff so apologies if this is cobblers.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #6 (permalink)
 KhaosTrader 
San Jose
 
Experience: Intermediate
Platform: NinjaTrader, Esignal
Trading: Stocks
Posts: 107 since Jan 2012
Thanks Given: 40
Thanks Received: 21

Yes thats good, but I was thinking like this...


 
Code
var customer = new Customer() {RequestID=request.ID, AddressID = 5 };
where I can use named parameters...

Also, defaults are supported in C# accessors, but not so in ninjascript as its not working...

 
Code
public int X { get; set; } = 5;
It would be great if i could just instantiate the indicator with no arguments, such that default values are loaded then I can just set the properties one by one, but it seems that this also is not possible....

Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


KhaosTrader View Post
Yes thats good, but I was thinking like this...


 
Code
var customer = new Customer() {RequestID=request.ID, AddressID = 5 };
where I can use named parameters...

Also, defaults are supported in C# accessors, but not so in ninjascript as its not working...

 
Code
public int X { get; set; } = 5;
It would be great if i could just instantiate the indicator with no arguments, such that default values are loaded then I can just set the properties one by one, but it seems that this also is not possible....

You probably need to talk to some of the more object-oriented types around here then - I don't get off on any of that fancy stuff, I just write programs (the kids now call them apps ) the way we always used to.

Cheers

Travel Well
Visit my NexusFi Trade Journal Reply With Quote




Last Updated on September 24, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts