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 ageeholdings, Today, 07:43 AM
      0 responses
      7 views
      0 likes
      Last Post ageeholdings  
      Started by pibrew, Today, 06:37 AM
      0 responses
      4 views
      0 likes
      Last Post pibrew
      by pibrew
       
      Started by rbeckmann05, Yesterday, 06:48 PM
      1 response
      14 views
      0 likes
      Last Post bltdavid  
      Started by llanqui, Today, 03:53 AM
      0 responses
      6 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      12 views
      0 likes
      Last Post burtoninlondon  
      Working...
      X