NexusFi: Find Your Edge


Home Menu

 





Reading the Parameters Window in NinjaScript


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one RCMT with 6 posts (4 thanks)
    2. looks_two Big Mike with 3 posts (1 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 ratfink with 1 posts (0 thanks)
    1. trending_up 4,411 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 11 posts
    2. attach_file 0 attachments




 
Search this Thread

Reading the Parameters Window in NinjaScript

  #1 (permalink)
 RCMT 
Vancouver Canada
 
Experience: Beginner
Platform: NinjaTrader,ThinkOrSwim
Trading: ES
Posts: 6 since Mar 2014
Thanks Given: 3
Thanks Received: 1

As part of my testing philosophy I'd like to be able to read the current NinjaScript parameter window (including not only the user defined Parameters section but also the Data Series, Time Frame, General, Historical Fill Processing, Order Handling and Order Properties sections) so that I can validate them and also so that I can write them out to a text file that is associated with the testing output logs for future reference.

Far too often I've done hours of testing (or even live trading) and then seen something significant when reviewing the logs that my strategies are made to create and puzzled over what the parameters were which created it. I've tried taking screen shots of the Parameters window but that's just clumsy. There HAS to be a better way!

I've searched and found nothing describing how I might accomplish this. I've found a way to iterate through the user defined parameters ( How to iterate over all user-created "this.Parameters" in NT Strategy code. - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum) but it fails my goal in two ways: it only provides the names of the parameters and it only iterates the user defined parameters (the oddly-named "Parameters" section) of the parameters window.

And so I turn to you, imploringly, and ask for assistance.

Any thoughts would be greatly appreciated.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
GFIs1 1 DAX trade per day journal
11 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
10 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599


I believe most everything you mentioned is accessible programatically with the right keywords. My NinjaScript is rusty, so others will have to chime in with the necessary info.

But as for the rest, start here:



It provides what you need for loading/saving parameters to/from XML file for strategies and such.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 RCMT 
Vancouver Canada
 
Experience: Beginner
Platform: NinjaTrader,ThinkOrSwim
Trading: ES
Posts: 6 since Mar 2014
Thanks Given: 3
Thanks Received: 1

Thanks Big Mike. At first blush this seems fairly intense for what I'm desiring to do but I'll definitely have a look at it.

I note in that thread that you mentioned loading parameters from a text file on startup. Were these parameters just your own custom parameters or were they system-wide items?

It really surprises me that NT doesn't expose the system-wide parameters in some supported way. I can't believe that I'm the only person who wants to do what I want to do!

I'm not really looking to save and load parameters (although that is unquestionably a cool thing!) I'm more looking to record the current values in a text file so that when I'm looking at my logs I can say with confidence that this was the setup which generated this result.

Started this thread Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599


RCMT View Post
It really surprises me that NT doesn't expose the system-wide parameters in some supported way. I can't believe that I'm the only person who wants to do what I want to do!

They do. I just can't remember all the keyword/reserve word names right now and don't have time to go look at my old Ninja source code on another computer. You'll need to ask around, but it is programatically available in NinjaScript.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 RCMT 
Vancouver Canada
 
Experience: Beginner
Platform: NinjaTrader,ThinkOrSwim
Trading: ES
Posts: 6 since Mar 2014
Thanks Given: 3
Thanks Received: 1


Big Mike View Post
You'll need to ask around

Mike


Thanks again, Mike. That's why I'm here, plaintively asking..

Is there any supplementary or third-party documentation or web sites (other than futures.io (formerly BMT) of course!) that you recommend for NinjaScript? The Version 7 Help Guide only goes so far.

Started this thread Reply With Quote
  #7 (permalink)
 RCMT 
Vancouver Canada
 
Experience: Beginner
Platform: NinjaTrader,ThinkOrSwim
Trading: ES
Posts: 6 since Mar 2014
Thanks Given: 3
Thanks Received: 1


RCMT View Post
Thanks again, Mike. That's why I'm here, plaintively asking..

Is there any supplementary or third-party documentation or web sites (other than futures.io (formerly BMT) of course!) that you recommend for NinjaScript? The Version 7 Help Guide only goes so far.

Still wondering if anyone has this information...

Mike? Any chance you could look at one of your old computers for this if no one else is forthcoming? Please?

Started this thread Reply With Quote
  #8 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599


RCMT View Post
Mike? Any chance you could look at one of your old computers for this if no one else is forthcoming? Please?

No chance. They are in storage and soon will be in the middle of the ocean.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #9 (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


RCMT View Post
Still wondering if anyone has this information...

Nope. Basically it doesn't exist. I would suggest your 2 main routes are to learn C# from books and the web, and learn NinjaScript techniques from downloadable code here on futures.io (formerly BMT). There's plenty of both, but as is traditional with programs writtens by programmers, there's bugger all else for users. There may be a few third-party courses and such if you want to go hunting.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 RCMT 
Vancouver Canada
 
Experience: Beginner
Platform: NinjaTrader,ThinkOrSwim
Trading: ES
Posts: 6 since Mar 2014
Thanks Given: 3
Thanks Received: 1


For the record, and for anyone else who wants to access this information, here are the elements that I've found (many converted to strings for consistent reference). The only one that I have not yet been able to find is the "Price based on" field from the Data Series group. You need to assign these to an appropriate variable in order to actually use them:

--- Data Series
ChartControl.BarsArray[0].BarsData.Period.MarketDataType.ToString(); //Price based on (Unsupported code according to NinjaTrader_Cal)
this.BarsPeriod.Value.ToString(); //Type
this.BarsPeriod.Id; // Value
this.Instrument.ToString(); //Instrument

--- Time Frame
this.Days2Load.ToString(); // Days to load
this.SessionData.ToString(); // Session Template

--- General
this.Account.Name; //Account
this.StrategyData.Strategy.CalculateOnBarClose // Calculate on Bars Close
this.Name; //Label
this.MaximumBarsLookBack.ToString(); //Maximum bars look back
this.BarsRequired.ToString(); //Min Bars Required

--- Historical Fill Processing
this.FillType.ToString(); //Fill type
this.Slippage.ToString(); //Slippage

--- Order Handling
this.EntriesPerDirection.ToString(); //Entries per direction
this.EntryHandling.ToString(); //Entry Handling
this.ExitOnClose.ToString(); // Exit on Close
this.ExitOnCloseSeconds.ToString(); // Exit on Close Seconds
this.StopTargetHandling.ToString(); //Stop & Target Submission
this.SyncAccountPosition.ToString(); //Sync Account Position

--- Order properties
this.QuantityType.ToString(); //Set Order Quantity
this.AccountSize.ToString(); // Account Size (for Order Quantity by account size)
this.DefaultQuantity.ToString(); // Default quantity (for Order quantity by default)
this.TimeInForce.ToString(); //Time in Force

Started this thread Reply With Quote
Thanked by:




Last Updated on November 1, 2014


© 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