• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unclear Results in Strategy Analyzer

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

    #16
    Hi Jim,

    I added the following Print statement and then did a Strategy Analyzer run and checked the Output Window.

    if ((Low[0] > EMA1[0])
    && ((VOL1[0] * VolUpInput1) >= (VOL1[1] * VolUpInput1) ))
    {
    EnterLong(Convert.ToInt32(DefaultQuantity), "");

    Print(@"Long Entry Submitted at: " + GetCurrentBid(0).ToString());
    }


    The Output Window did show that trades were entered.

    But the analysis produced a net profit of $0.00 this time, but with 4381 trades.

    Screenshot of Output Window and analysis run attached.

    I'll try again with a different market and with different inputs.

    Comment


      #17
      I think I know why my last Strategy Analyzer run returned no trades; I forgot to change the stop-loss and profit targets from their default values of $1.

      So I set them and then did another Strategy Analyzer run (after adding a Print statement earlier).

      This time I did have a total net profit amount and 1305 total trades, but again, the metrics are identical for each one of the best 10 trades (and I'm sure this would be the case for the first 100 trades).

      Screenshots attached.

      How do I debug why I'm getting robot-like results that appear to be questionable every time?

      Comment


        #18
        Hello i2w8am9ii2,

        A print inside a condition will tell you that the condition has become true. What you want to know is "At a specific trade, why is this condition becoming true consistently between optimization iterations?" This would be found by reducing your test period to focus on one or a few trades, then to add prints outside of the conditions so you can tell how they are being evaluated.

        ((VOL1[0] * VolUpInput1) >= (VOL1[1] * VolUpInput1) ))

        How is this condition evaluated? Let's come up with some examples to see if there would be a difference in evaluation.

        ((VOL1[0] * 1) >= (VOL1[1] * 1) ))

        ((VOL1[0] * 2) >= (VOL1[1] * 2) ))

        ((VOL1[0] * 3) >= (VOL1[1] * 3) ))

        ((VOL1[0] * 9001) >= (VOL1[1] * 9001) ))

        A scientific approach to analyzing the logic you have come up with would be the approach you would need to take while debugging.

        I've included a demonstration showing how User Defined Inputs can be set up and tested in the Strategy Analyzer - https://drive.google.com/file/d/1X9g...w?usp=drivesdk
        JimNinjaTrader Customer Service

        Comment


          #19
          Hi Jim,

          Thanks so much for the detailed explanation and for the videos.

          I do appreciate your help very much.

          I will go through the video and continue with debugging.

          Thanks again,

          Comment


            #20
            Hi Jim,

            Your video helped me start to understand.

            I edited some of my code, but now I get a 'Method Name Expected' error.

            Screenshot of my new code attached.

            What does that error mean and how to I resolve it?

            Comment


              #21
              Hello i2w8am9ii2,

              As I mentioned, we do not provide programming education in the support department at NinjaTrader. (This is because we are a small team and we do not have the bandwidth to provide programming education services to all of our clients while maintaining high quality technical support services.) You have written some invalid syntax and you are receiving a compiler error on that syntax. I would suggest referencing compiler errors on Google as there are vast C# educational materials that explain compiler errors and how to write proper C# syntax. I would also suggest reviewing our open source indicators for further reference on writing correct syntax.

              Outside of these options, you could still continue learning using the Strategy Builder, and we could also have a representative of our EcoSystem reach out with additional information on NinjaScript Consultants who would be happy to create a NinjaScript strategy or indicator at your request. The EcoSystem also has educators as well. Let me know if this is an option that interests you.

              If there are any NinjaScript items we can assist with outside of C# syntax, please let us know.
              JimNinjaTrader Customer Service

              Comment


                #22
                Hi Jim,

                Thanks for your reply.

                I understand. And I do appreciate the two video links and text explanations that you provided here very much.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Sulfred, Today, 12:34 AM
                2 responses
                13 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by CopyPasteGhost, Today, 11:22 AM
                0 responses
                1 view
                0 likes
                Last Post CopyPasteGhost  
                Started by 1001111, Today, 10:23 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_PaulG  
                Started by NinjaCustomer, Today, 11:07 AM
                0 responses
                4 views
                0 likes
                Last Post NinjaCustomer  
                Started by NtFan, Today, 10:47 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X