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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X