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

Pulling the correct values in a strategy?

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

    Pulling the correct values in a strategy?

    Greetings,

    I'm trying to put together a strategy using the wizard. My question is fairly simple I think--how do I know if the strategy is correctly using the correct variable within the indicator I wish? For example, using the attached screens, how can I be sure that the "SMI Signal" variable within the strategy called "SMI" is the variable being correctly used in my examples? How do I know it's not pulling the values of one of the other variables?

    Thanks in advance.
    Attached Files

    #2
    Hi Burga1,

    I am unfamiliar with the way your SMI indicator is coded. From the looks of the screenshots, it would appear your SMI indicator's signal variable is defined once at start and never modified.

    Normally, you don't check variables per se because those are user definable when you call the indicator. You would check the indicator's plot values which are dynamically changing. For instance, take a look at the Bollinger indicator in the condition builder. You will see a property called "Plot" and you can see you can select 3 different plots: Upper, Middle, Lower.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Yes, I see that "plot" field where variables can be selected. I guess what I need to know is how to create that in my SMI indicator...I've tried doing so by exposing a public property for the variable...this causes it to show as an entry field but not as a "plot"...I'm confused about how to go about this. Thanks.

      Comment


        #4
        If you generate your indicator through the wizard there is a page where it asks you about Plots. You can add plots there. After you the plot you can use .Set to set values to that plot. Then you can start using it.

        If you run the indicator wizard on all default settings you will notice at the end the line in the OnBarUpdate() is this: Plot0.Set(Close[0]);

        What that is saying set the plot named "Plot0" to take the value of the current bar's close. Basically Plot0 will be associated with every bar's close. On bar 1 Plot0 will have the value of the close of that bar. On bar 2 Plot0 will have the value of the close of bar 2. etc etc. Hope that makes sense. Just mimic the way the wizard generates the plots and you should be able to use it.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thank you Josh, that makes more sense to me...I'll give it a shot.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by chbruno, Today, 04:10 PM
          0 responses
          1 view
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          436 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          5 views
          0 likes
          Last Post FAQtrader  
          Started by rocketman7, Today, 09:41 AM
          5 responses
          19 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by frslvr, 04-11-2024, 07:26 AM
          9 responses
          127 views
          1 like
          Last Post caryc123  
          Working...
          X