Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator/Strategy relationship

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

    Indicator/Strategy relationship

    Hi,
    I have a question about the relationship between the indicator and strategy.
    If I have a variable called trigger that is updated in a indicator when the opupdate() fucntion is serviced, and I reference that variable in a strategy, how does it get updated within the strategy. I created a simple test strategy and setup a condition based on the variable. What I am seeing is it never gets passed over to the strategy. Is there a specific way I must access it after I have used the add Trigger() in the strategy ?

    I hope this makes sense what I am asking
    Thanks

    #2
    Widgetman, did you expose this variable to be acccessed from the strategy? This reference sample will show you how this is accomplished - http://www.ninjatrader-support2.com/...ead.php?t=4991

    Comment


      #3
      Hi,
      Thanks for the reply. I am pretty sure I have exposed it in the strategy by doing a ADD( FunctionName(Trigger)) in the init routine. I then check the state of the variable by doing a if FunctionName.Trigger == x, but I get a error CS0119 when I try to compile. I looked in the help and there is no help data for this error. Any ideas ?
      Thanks

      Comment


        #4
        It would be helpful if you can post your code snippet so we can take a look, also I think you would want to expose the variable in the indicator not in the strategy.

        Comment


          #5
          Hi,
          Thanks for the help. My code is so convaluted it would be hard to trace thru. Is there a simple strategy example available that uses a simple indicator which checks a variable in the indicator itself ? I looked thru a few but did not see any examples using a specific variable from the indicator as a trigger.
          Thanks

          Comment


            #6
            I'm unfortunately not aware of a more specific one than this from our helpguide Widgetman - http://www.ninjatrader-support.com/H...V6/Update.html

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmoran13, Yesterday, 01:02 PM
            0 responses
            29 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            21 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            160 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            95 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            148 views
            2 likes
            Last Post CaptainJack  
            Working...
            X