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 jaybedreamin, Today, 05:56 PM
            0 responses
            3 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            1 view
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            6 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Working...
            X