Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart Control

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

    Chart Control

    public static double GetValues(this ChartControl chart)
    {
    double x = 0.0;
    double y = 0.0;.
    double a=0.0
    double b=0.0;
    double c=0.0
    double d=0.0;


    x = chart.BarsArray[0].Instrument.MasterInstrument.RoundToTickSize(chart .FixedPanelMaxRight);

    y= chart.BarsArray[0].Instrument.MasterInstrument.RoundToTickSize(chart .FixedPanelMinRight);

    a = chart.BarsArray[0].Instrument.MasterInstrument. RoundToTickSize(chart.FixedPanelMaxLeft);

    b = chart.BarsArray[0].Instrument.MasterInstrument. RoundToTickSize (chart.FixedPanelMinLeft);

    c = chart.BarsArray[0].Instrument.MasterInstrument. RoundToTickSize(chart. FixedPanelMaxOverlay);

    d= chart.BarsArray[0].Instrument.MasterInstrument. RoundToTickSize (chart. FixedPanelMinOverlay);

    int k = chart.GetYByValue(chart.BarsArray[0], x);
    }


    The following are the errors from Ninja Trader 8

    1. NinjaTrader.Gui.Chart.ChartBars does not contain definition for ‘Instrument’ accepting a first argument of type ‘NinjaTrader.Gui.Chart.ChartBars’ could be found(are you missing a using directive or an assembly reference?)

    2. NinjaTrader.Gui.Chart.ChartControl does not contain definition for ‘FixedPanelMaxRight and no extension method ‘FixedPanelMaxRight accepting a first argument of type ‘NinjaTrader.Gui.Chart. ChartControl could be found(are you missing a using directive or an assembly reference?)

    3. NinjaTrader.Gui.Chart.ChartControl does not contain definition for ‘FixedPanelMinRight’ and no extension method ‘FixedPanelMinRight’ accepting a first argument of type ‘NinjaTrader.Gui.Chart. ChartControl could be found(are you missing a using directive or an assembly reference?)

    4. NinjaTrader.Gui.Chart.ChartControl does not contain definition for ‘FixedPanelMaxLeft ‘and no extension method ‘FixedPanelMaxLeft accepting a first argument of type ‘NinjaTrader.Gui.Chart. ChartControl could be found(are you missing a using directive or an assembly reference?)

    5. NinjaTrader.Gui.Chart.ChartControl does not contain definition for ‘FixedPanelMinLeft ‘and no extension method ‘FixedPanelMinLeft accepting a first argument of type ‘NinjaTrader.Gui.Chart. ChartControl could be found(are you missing a using directive or an assembly reference?)

    6. NinjaTrader.Gui.Chart.ChartControl does not contain definition for ‘FixedPanelMaxOverlay’ and no extension method ‘FixedPanelMaxOverlay’ accepting a first argument of type ‘NinjaTrader.Gui.Chart. ChartControl could be found(are you missing a using directive or an assembly reference?)

    7. NinjaTrader.Gui.Chart.ChartControl does not contain definition for ‘FixedPanelMinOverlay‘ and no extension method ‘FixedPanelMinOverlay accepting a first argument of type ‘NinjaTrader.Gui.Chart. ChartControl could be found(are you missing a using directive or an assembly reference?)

    8. NinjaTrader.Gui.Chart.ChartControl does not contain definition for ‘GetByValue‘ and no extension method ‘GetByValue accepting a first argument of type ‘NinjaTrader.Gui.Chart. ChartControl could be found(are you mising a using directive or an assembly reference?)

    So may I know how we solve the above issues..? or does Ninja Trader 8 future release have more completed work on these ChartControl areas .?

    #2
    Originally posted by rmk View Post
    The following are the errors from Ninja Trader 8

    1. NinjaTrader.Gui.Chart.ChartBars does not contain definition for ‘Instrument’ accepting a first argument of type ‘NinjaTrader.Gui.Chart.ChartBars’ could be found(are you missing a using directive or an assembly reference?)
    There is Bars object you will need to drill down to

    Code:
    ChartControl.BarsArray[0].Bars.Instrument.MasterInstrument.RoundDownToTickSize(x);
    Originally posted by rmk View Post
    2. NinjaTrader.Gui.Chart.ChartControl does not contain definition for ‘FixedPanelMaxRight and no extension method ‘FixedPanelMaxRight accepting a first argument of type ‘NinjaTrader.Gui.Chart. ChartControl could be found(are you missing a using directive or an assembly reference?)

    For these panel items, you will need to use the chartScale object through OnRender:

    Code:
    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    {
    	double min = chartScale.MinValue;
    	double max = chartScale.MaxValue;
    }
    There is not a separate property for each scale (left, right, overlay), so you will need to check the ChartScale.ScaleJustification property, in some manner. For example:

    Code:
    //FixedPanelMaxRight->
    x = chartScale.ScaleJustification == ScaleJustification.Right 
    	? chartBars.Bars.Instrument.MasterInstrument.RoundToTickSize(chartScale.MaxValue) : 0;
    
    //FixedPanelMaxLeft->
    a = chartScale.ScaleJustification == ScaleJustification.Left
    ? chartBars.Bars.Instrument.MasterInstrument.RoundToTickSize(chartScale.MaxValue) : 0;
    
    //FixedPanelMaxOverlay->
    c = chartScale.ScaleJustification == ScaleJustification.Overlay 
    	? chartBars.Bars.Instrument.MasterInstrument.RoundToTickSize(chartScale.MaxValue) : 0;
    
    //etc
    Originally posted by rmk View Post
    8. NinjaTrader.Gui.Chart.ChartControl does not contain definition for ‘GetByValue‘ and no extension method ‘GetByValue accepting a first argument of type ‘NinjaTrader.Gui.Chart. ChartControl could be found(are you mising a using directive or an assembly reference?)
    This is also in chartScale, and now only takes a value argument

    Code:
    chartScale.GetYByValue(x);
    Originally posted by rmk View Post
    or does Ninja Trader 8 future release have more completed work on these ChartControl areas .?
    The work here is complete, what you may be missing is chart control has been broken up into:

    ChartControl-> X axis (more or less)
    ChartScale-> Y axis
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rocketman7, Today, 01:00 AM
    0 responses
    1 view
    0 likes
    Last Post rocketman7  
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    27 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 02-22-2024, 01:11 AM
    5 responses
    32 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 04-23-2024, 09:53 PM
    2 responses
    74 views
    0 likes
    Last Post wzgy0920  
    Started by Kensonprib, 04-28-2021, 10:11 AM
    5 responses
    193 views
    0 likes
    Last Post Hasadafa  
    Working...
    X