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 jxs_xrj, 01-12-2020, 09:49 AM
    6 responses
    3,290 views
    1 like
    Last Post jgualdronc  
    Started by Touch-Ups, Today, 10:36 AM
    0 responses
    8 views
    0 likes
    Last Post Touch-Ups  
    Started by geddyisodin, 04-25-2024, 05:20 AM
    8 responses
    61 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Option Whisperer, Today, 09:55 AM
    0 responses
    8 views
    0 likes
    Last Post Option Whisperer  
    Started by halgo_boulder, 04-20-2024, 08:44 AM
    2 responses
    24 views
    0 likes
    Last Post halgo_boulder  
    Working...
    X