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 MarianApalaghiei, Today, 10:49 PM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by XXtrader, Today, 11:30 PM
      0 responses
      3 views
      0 likes
      Last Post XXtrader  
      Started by love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      9 views
      0 likes
      Last Post funk10101  
      Started by pkefal, 04-11-2024, 07:39 AM
      11 responses
      37 views
      0 likes
      Last Post jeronymite  
      Working...
      X