Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Wizard - Get Indicator Value from 3 bars

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

    Strategy Wizard - Get Indicator Value from 3 bars

    Hi,

    Is it possible using the strategy wizard (I'm not a programmer), to get the value of an indicator for the past 3 bars and add the total and then compare to a value? For example:

    Indicatorvalue(bar2) + Indicatorvalue(bar1) + Indicatorvalue(bar0) = totalvalue.

    totalvalue < 20

    Thank you.

    #2
    Hello bob77713,

    You may try to use the User Variable to be able to calculate this inside of the Strategy Wizard for something like this. Note that your Condition will have to be true before you use the variable so that NinjaTrader does the calculations before you use it.

    To do this you would want to use a "Set a user defined variable" in your Strategy Action part. Then under value, you may select your Indicator and add an Offset Type of Price, and select the Indicator again as the Offset with your Bars Ago reference. See attached screenshot for an example.
    Attached Files
    JCNinjaTrader Customer Service

    Comment


      #3
      JC,

      Thank you very much! It's exactly what I was looking for.

      Thanks,

      Bob

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      68 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      36 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      61 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X