Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exposing a Variable for use in a strategy

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

    Exposing a Variable for use in a strategy

    I am working on a strategy which will go long if certain conditions are met and an avg line, which changes color depending on its slope, is the right color. To make the "color" available to a strategy I have created a variable which is set to a number depending on the color of the plot. I've embedded along with the plot statement but I don't know how to make it accessible to a strategy. Here's a sample of the code:

    Code:
    if (Rising(SMA(Period)))
         {
         // Connects the rising plot segment with the other plots
         RisingPlot.Set(1, SMA(Period)[1]);
         LColText = 1;
         }
    I'm pretty sure I need to somehow add a statement in the "Properties" section
    or perhaps do that as well as create a dataseries but the things I've tried don't work. If there is a code sample somewhere that outlines this I would be grateful to see it.
    Thanks
    DaveN

    #2
    You would need to expose this dataseries in the indicator to access it in the strategy then - http://www.ninjatrader-support2.com/...ead.php?t=4991

    Comment


      #3
      Exposing a Variable for use in a strategy

      Bertrand,
      Thanks for your help and guidance to the sample code. It works though I am still having trouble making the text variable visible outside the indicator so that it can be used in a strategy.
      Thanks
      DaveN

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      647 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X