Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

plotting indicator within strategy

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

    plotting indicator within strategy

    I built a very simple strategy using your samplestrategyplot.zip file as a guide. It creates a second pane as desired and scales it as though the indicator was there, but no indicator shows up.

    The data is there because I'm writing it at the same time to an output window. Can you tell me what is out of whack with this? Any direction would be appreciated.

    Safetrading

    publicclass TestStrategy1 : Strategy
    {
    #region Variables
    privateint myInput0 = 1;
    double LastAsk = 0;
    double LastBid = 0;
    double myLast = 0;
    double delta = 0;
    double upvol = 0;
    double downvol = 0;
    #endregion

    protectedoverridevoid Initialize()
    {
    CalculateOnBarClose = true;
    Add(StrategyPlot(0));
    Add(StrategyPlot(1));
    StrategyPlot(0).Plots[0].Pen.Color = Color.Blue;
    StrategyPlot(1).Plots[0].Pen.Color = Color.DeepSkyBlue;
    StrategyPlot(0).PanelUI = 2;
    StrategyPlot(1).PanelUI = 2;
    upvol = 0;
    downvol = 0;
    }
    protectedoverridevoid OnMarketData(MarketDataEventArgs e)
    {

    if (e.MarketDataType == MarketDataType.Last && e.Price >= GetCurrentAsk())
    {
    upvol = upvol + e.Volume;
    Print("Up Vol " + upvol.ToString());
    }
    elseif (e.MarketDataType == MarketDataType.Last && e.Price >= GetCurrentBid())

    downvol = downvol + e.Volume;
    Print("Down Vol " + downvol.ToString());

    StrategyPlot(0).Value.Set(upvol);
    StrategyPlot(1).Value.Set(downvol);


    #2
    Safetrading,

    Could you check your log tab in the control center for any error messages and report here?
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      I delve into strategyplots,and see,in "StrategyPlot StrategyPlot(Data.IDataSeries input, int id)"
      a phrase:cacheStrategyPlot[idx].EqualsInput(input)
      Please tell me what is EqualsInput(input) and how it works.
      Thank you!

      Comment


        #4
        maorachow, unfortunately we could not support this undocumented method used in the wrappers for NinjaScript.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          reply

          I don't see where I posted the code you are referring to, also unfortunately I don't know what it means, sorry.

          Safetrading

          Originally posted by maorachow View Post
          I delve into strategyplots,and see,in "StrategyPlot StrategyPlot(Data.IDataSeries input, int id)"
          a phrase:cacheStrategyPlot[idx].EqualsInput(input)
          Please tell me what is EqualsInput(input) and how it works.
          Thank you!

          Comment


            #6
            Open the file in NotePad,then the hiden code will display.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by GussJ, 03-04-2020, 03:11 PM
            15 responses
            3,271 views
            0 likes
            Last Post xiinteractive  
            Started by Tim-c, Today, 02:10 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Taddypole, Today, 02:47 PM
            0 responses
            2 views
            0 likes
            Last Post Taddypole  
            Started by chbruno, 04-24-2024, 04:10 PM
            4 responses
            51 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by TraderG23, 12-08-2023, 07:56 AM
            10 responses
            403 views
            1 like
            Last Post beobast
            by beobast
             
            Working...
            X