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!
See more
See less

Partner 728x90

Collapse

NT8 AddDataSeries get TickSize from onStateChange

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NT8 AddDataSeries get TickSize from onStateChange

    Can I get the tick size for a data series I have added in the onStateChange, State.Configure area?

    For example:

    Code:
    AddDataSeries("EURUSD", (BarsPeriodType)15, 1, Data.MarketDataType.Last);
    someVariable = BarsArray[1].Instrument.MasterInstrument.TickSize;
    BarsArray[1] is not yet set at this point, is there some other way to access tick size at this point for the added data series?

    #2
    Looks like the BarsArray[1].Instrument.MasterInstrument.TickSize only relates to the primary instrument (makes sense based on the verbiage). So how do we access the added data series tick size in either the onStatusChange or the onBarUpdate
    Last edited by fxRichard; 06-26-2016, 05:03 PM.

    Comment


      #3
      Hello fxRichard

      Thanks for your posts.

      The TickSize will be available by BarsInProgress. For example:
      Code:
      			else if (State == State.Configure)
      			{
      				AddDataSeries("EURUSD", BarsPeriodType.Minute, 1, Data.MarketDataType.Last);
      			}
      		}
      
      		protected override void OnBarUpdate()
      		{
      
      			if (BarsInProgress == 0 && doitonce1)
      			{
      				Print ("BIP0 TickSize: "+TickSize);
      				doitonce1 = false;
      			}
      			
      			if (BarsInProgress == 1 && doitonce2)
      			{
      				Print ("BIP1 TickSize: "+TickSize);
      				doitonce2 = false;
      			}
      With BIP0 = ES 09-16 and BIP1 = EURUSD :
      BIP0 TickSize: 0.25
      BIP1 TickSize: 1E-05
      Paul H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      2 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      11 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      12 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,982 views
      3 likes
      Last Post jhudas88  
      Working...
      X