Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Debug indicator in strategy

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

    Debug indicator in strategy

    I am trying to debug entrys in a strategy using DoubleStochastics indicator. I don't understand objects and classes well enough.
    Here is my code sample:
    //c = DoubleStochastics(10).K;
    //this.PrintWithTimeStamp("DS10 " + c.ToString("N2"));

    TIA

    #2
    maxsys, sorry for our late reply here. Which issue do you see with this Print? This would give you the main DoubleStochastic value, %K. You want to specify though which value you would want to access from it, since per default the method would give you a series return - http://www.ninjatrader.com/support/h...tochastics.htm

    So adding a [0] index to your call would mean you want to print the value of the last closed bar that called OnBarUpdate() of your script.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      see attachment for error

      Note: c is defined as a double
      #region Variables
      private double c = 0;

      Comment


        #4
        Here is the error code:
        NinjaScript File,Error,Code,Line,Column,
        Strategy\MyCustomStrategy.cs,Operator '+' cannot be applied to operands of type 'NinjaTrader.Data.IDataSeries' and 'int',NT0019 - click for info,48,68,

        Comment


          #5
          Finally got it figured out, variable assignments were off.
          Thanks

          Comment


            #6
            We're glad to hear that, thanks for the update.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Rainmakersg, Today, 02:09 AM
            0 responses
            7 views
            0 likes
            Last Post Rainmakersg  
            Started by frantic, 01-21-2020, 02:34 PM
            75 responses
            4,622 views
            0 likes
            Last Post Brockjava  
            Started by siddhugaddi, Yesterday, 10:48 AM
            2 responses
            24 views
            0 likes
            Last Post siddhugaddi  
            Started by Bob-Habanai, 09-14-2024, 08:10 AM
            2 responses
            23 views
            0 likes
            Last Post Bob-Habanai  
            Started by go2toa, 09-14-2024, 05:43 AM
            2 responses
            22 views
            0 likes
            Last Post go2toa
            by go2toa
             
            Working...
            X