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

exposing the wavetrend indicator for strategy builder

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

    #46
    Even if I comment out everything but the Property and the AddPlot it still gives the same error so the error had to of came from them. Probably just from having the property.
    By just having the Property (and everything else commented out) I get this error:
    Strategy 'ExposedStrategy': Error on calling 'OnBarUpdate' method on bar 2: Index was outside the bounds of the array.

    Comment


      #47
      Originally posted by Nyman View Post
      Can someone please provide sufficient reference on how to use the DivergenceInputsSeries indicator in strategy builder? I want access to the signal when the up and down divergence has occurred and perhaps compare it to some value. I have followed the entire discussion above but no definite solution. I would to make the changes inside of the DivergenceInputsSeries indicator.
      Hello Nyman,

      Are you referring to this indicator on the User App Share? (As a tip, be sure to include the indicator you are inquiring about)
      https://ninjatraderecosystem.com/use...inputseries-2/

      Instead of two private bool series declared on lines 29 and 30, change this to plots added with AddPlot() and the Values returned as public Series<double> objects using the XmlIgnore attribute.

      Below is a link to example code.
      https://ninjatrader.com/support/foru...64#post1182264

      Where Signalup[0] / Signaldn[0] was previously set to false, set this to 0 (to represent false), where Signalup[0] / Signaldn[0] was previously set to true, set this to 1 (to represent true).



      Originally posted by ezrollin View Post
      Even if I comment out everything but the Property and the AddPlot it still gives the same error so the error had to of came from them. Probably just from having the property.
      By just having the Property (and everything else commented out) I get this error:
      ezrollin,

      I see you are using Values[2]. Have you called AddPlot() 3 times for Values[0], Values[1], and Values[2]?

      What do you get for a print of Values.Count()?

      Can you provide an export of a reduced test script demonstrating the behavior?

      To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
      1. Click Tools -> Export -> NinjaScript...
      2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
      3. Click the 'Export' button
      4. Enter a unique name for the file in the value for 'File name:'
      5. Choose a save location -> click Save
      6. Click OK to clear the export location message
      By default your exported file will be in the following location:
      • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
      Below is a link to the help guide on Exporting NinjaScripts.
      http://ninjatrader.com/support/helpG...-us/export.htm

      Once exported, please attach the file as an attachment to your reply.
      Last edited by NinjaTrader_ChelseaB; 08-31-2022, 03:20 PM.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #48
        Originally posted by NinjaTrader_ChelseaB View Post
        Hey Chelsea,
        I'm not sure where I would add the print. If I put it in my main OnBarUpdate, I just get a bunch of 3s.
        I guess I should be adding it in that property's section?

        Can I email the indicator to you since its private? thanks

        Comment


          #49
          Hello ezrollin,

          So this remains educational for the community, I recommend you create a simplified test script that just adds the plots and the public series properties that returns the values for those plots and a simple value set.
          This test script should not contain any custom logic, to help focus on the issue at hand.

          In post #4, I have provided a link to a working example.
          https://ninjatrader.com/support/foru...64#post1182264
          https://ninjatrader.com/support/foru...238#post812238
          Last edited by NinjaTrader_ChelseaB; 08-31-2022, 03:21 PM.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #50
            Originally posted by NinjaTrader_ChelseaB View Post
            Hello ezrollin,

            So this remains educational for the community, I recommend you create a simplified test script that just adds the plots and the public series properties that returns the values for those plots and a simple value set.
            This test script should not contain any custom logic, to help focus on the issue at hand.

            In post #4, I have provided a link to a working example.
            https://ninjatrader.com/support/foru...64#post1182264
            https://ninjatrader.com/support/foru...238#post812238
            ezrollin - Were you ever able to successfully modify the WaveTrendV2 indicator to expose the WTFast and WTSlow plots or fully baked bull and bear crossover signals? I am very interested in using this indicator in strategies as well...

            Comment


              #51
              I dont think I was. Any time I've gotten any of the exposing to work, I havent felt confident in it at all. It hasnt worked right.
              Its a shame cause it seems like a good indicator

              Comment


                #52
                Originally posted by ezrollin View Post
                I dont think I was. Any time I've gotten any of the exposing to work, I havent felt confident in it at all. It hasnt worked right.
                Its a shame cause it seems like a good indicator
                Hey ezrollin - I was able to get the Fast and Slow lines exposed as public plots. Pretty simple, actually. Just add the following under the Properties section at the bottom and compile and you should then have "FastLine" and "SlowLine" available as plots in Strategy Builder and can use them with the "Cross Above" and "Cross Below" conditions to get your trade entries.

                Code:
                public Series<double> FastLine
                {
                get { return Values[0]; }
                }
                
                public Series<double> SlowLine
                {
                get { return Values[1]; }
                }


                Click image for larger version

Name:	image.png
Views:	161
Size:	65.2 KB
ID:	1215912

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by nandhumca, Yesterday, 03:41 PM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by The_Sec, Yesterday, 03:37 PM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by vecnopus, Today, 06:15 AM
                0 responses
                1 view
                0 likes
                Last Post vecnopus  
                Started by Aviram Y, Today, 05:29 AM
                0 responses
                5 views
                0 likes
                Last Post Aviram Y  
                Started by quantismo, 04-17-2024, 05:13 PM
                3 responses
                27 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Working...
                X