• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What calls would I used to identify chart type and chart scale (Eg # ticks per bar)

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

    What calls would I used to identify chart type and chart scale (Eg # ticks per bar)



    I am getting tired of tweaking parameters in indicators and strategies per chart.

    I know how to identify the primary instrument but not the rest below and search has not yet surfaced answers.

    I know this will limit some efficiency opportunities but in some cases I would like to code up my indicators and strategies to query for the chart type, selected scale of bars (e..g # of ticks or Range value per bar) and if Chart Trader has been enabled or not.

    How would I do (code) that?

    Thanks!

    #2
    Hello hedgeplay,

    Thank you for your note.

    You can find these in the ChartControl.Properties and the ChartBars.Properties:

    https://ninjatrader.com/support/help...properties.htm

    https://ninjatrader.com/support/help...properties.htm

    Here's a quick example that will print some information for each bar when used in OnBarUpdate():

    Code:
    protected override void OnBarUpdate()
    {
    if(ChartControl != null)
    {
    Print(ChartControl.Properties.ChartTraderVisibility);
    }
    if(ChartBars != null)
    {
    Print(ChartBars.Properties.BarsPeriod.BarsPeriodTypeName);
    Print(ChartBars.Properties.BarsPeriod.Value);
    Print(ChartBars.Properties.ChartStyle.ChartStyleType);
    }
    }
    Since a strategy or indicator can be applied in other places than a chart, it's important to have the ChartBars and ChartControl null checks so the code is only executed if the indicator/strategy is running on a chart.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Perfect.

      Thanks Kate!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bumbledbee, Today, 04:28 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Marco  
      Started by Tmaninc, Today, 02:13 AM
      3 responses
      12 views
      0 likes
      Last Post Tmaninc
      by Tmaninc
       
      Started by rexmie888, Yesterday, 09:37 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by larkmail, Yesterday, 06:19 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Marco  
      Started by jvanelli, Yesterday, 09:23 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Marco  
      Working...
      X