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

Data Series and String.Compare

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

    Data Series and String.Compare

    I have an indicator that works fine with one series on the panel but if I put 2 ( int this case MES and ES) then it no longer works.
    The toolbar button is fully functional but the properties of the BarsArray is not changing.
    I thought if i put a user property MySeries (eg 0 or 1) it might solve the issue but it doesn't.


    Here is my code

    Code:
    if( String.Compare(ShowExecState,"EXECUTION MARKERS ONLY") == 0 )
    {
    ShowExecState = "FULL TEXT EXECUTION MARKERS";
    
    ChartControl.BarsArray[MySeries].Properties.PlotExecutions = ChartExecutionStyle.TextAndMarker;
    myItem.Header= "FULL";
    myItem.Foreground = Brushes.Red;
    ShowTextAndMarker = false;// a bool to ensure it only triggers once per click
    }
    Edit - If I change my primary DataSeries around it does work?
    So my trades are on MES - which this indicator will change ChartExecutionStyle when MES is primary but not when it's secondary?
    Is that correct behaviour? Should MySeries not change that?
    Last edited by Mindset; 09-30-2020, 02:58 AM.

    #2
    Hello Mindset,

    Thanks for your post.

    Are you trying to change the ChartBars that the indicator is attached to or another ChartBars on the chart?

    If you are trying to change the ChartBars that the indicator is attached to, I suggest to simply use the indicator's ChartBars property.

    this.ChartBars.Properties.PlotExecutions = ChartExecutionStyle.TextAndMarker;

    Could you clarify if you are trying to find a different ChartBars?

    When I try changing properties of all ChartBars in ChartControl.BarsArray, I do not experience an issue.

    Code:
    foreach (ChartBars chtbrs in ChartControl.BarsArray)
        chtbrs.Properties.PaintPriceMarker = false;
    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      no I am trying to change the chartbars that the indicator is attached to. Thank you for the explanation. All Sorted

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AveryFlynn, Today, 04:57 AM
      0 responses
      3 views
      0 likes
      Last Post AveryFlynn  
      Started by RubenCazorla, 08-30-2022, 06:36 AM
      3 responses
      77 views
      0 likes
      Last Post PaulMohn  
      Started by f.saeidi, Yesterday, 12:14 PM
      9 responses
      23 views
      0 likes
      Last Post f.saeidi  
      Started by Tim-c, Today, 03:54 AM
      0 responses
      3 views
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by FrancisMorro, Today, 03:24 AM
      0 responses
      5 views
      0 likes
      Last Post FrancisMorro  
      Working...
      X