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 rhyminkevin, Today, 04:58 PM
      2 responses
      46 views
      0 likes
      Last Post loosek
      by loosek
       
      Started by iceman2018, Today, 05:07 PM
      0 responses
      5 views
      0 likes
      Last Post iceman2018  
      Started by lightsun47, Today, 03:51 PM
      0 responses
      7 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      14 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      49 views
      0 likes
      Last Post futtrader  
      Working...
      X