Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Plot Issues

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

    Strategy Plot Issues

    I am using a multi-time frame strategy and would like to plot the values to verify my calculations. However, it appears that the StrategyPlot will only work if BarsInProgress=0, which is causing a problem for me. Below is my code...

    Initialize:
    Code:
    Add(ES 06-10,BarsPeriod.Id,BarsPeriod.Value);
    			
    
    /* Add our blank placeholder indicators. The parameter we pass in is used to distinguish the two
    indicators from each other. */
    Add(StrategyPlot(0));
    Add(StrategyPlot(1));
    			
    // Set the color for the indicator plots
    StrategyPlot(0).Plots[0].Pen.Color = Color.Blue;
    StrategyPlot(1).Plots[0].Pen.Color = Color.Green;
    			
    // Set the panel which the plots will be placed on. 1 = price panel, 2 = panel under the price panel, etc.
    StrategyPlot(0).PanelUI = 2;
    StrategyPlot(1).PanelUI = 2;
    OnBarUpdate:
    Code:
    if (Times[0][0]==Times[1][0])
    {					
    	ratio.Set(Closes[0][0]/Closes[1][0]);						
    	ma = SMA(ratio,ratioAverage)[0];				
    
            // plot ratio and average			
            StrategyPlot(0).Value.Set(ratio[0]);
    StrategyPlot(1).Value.Set(ma);															
    }
    I compare the times of each bar to ensure that I am comparing the same bar of each instrument, however, nothing plots. If I move the plots outside of my time check, I do get plots, but they are way off. Any ideas what I may be doing wrong?
    Last edited by toptrader; 03-31-2010, 08:41 AM.

    #2
    toptrader,

    Your chart is a chart of BIP0. There is no chart of BIP1, etc. So this means anything you plot has to be in the context of BIP0. You only have the number of points you can plot as seen in BIP0. If BIP1 has more/less data points, you cannot show that granularity.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hello

      I am also trying to use Plot in my strategy...
      where did he get the StrategyPlot class from ??

      Comment


        #4
        zooinek,

        StrategyPlot() is just a blank indicator. You can get it from this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=6651
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        87 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        47 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        66 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        69 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        58 views
        0 likes
        Last Post CarlTrading  
        Working...
        X