Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to see custom indicator in conditions & actions within Strategy Builder

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

    Unable to see custom indicator in conditions & actions within Strategy Builder

    Hello,

    I was looking for a post that could answer my question before posting here. I found this https://ninjatrader.com/support/foru...t-plots?t=4991 which was exactly what I was looking for. I understand everything explained and I've downloaded the examples to view the sample code.

    I have a custom indicator that basically does the same underlying thing as the example provided. Expose two Series<bool> variables that can be used in conjunction with other indicators for evaluating a bearIndication or bullIndication on each bar. I've done what I believe is required to be able to use this indicator in the Strategy Builder:

    Code:
    //Class variables defined
    private Series<bool> bearIndication;
    private Series<bool> bullIndication;​
    
    //..Inside State.Configure
    bullIndication                = new Series<bool>(this);
    bearIndication               = new Series<bool>(this);​
    
    //..Inside OnBarUpdate()
    //Stuff happens
    bearIndication[0] = (true);
    
    //Other Stuff happens
    bullIndication[0] = (true);​
    
    //In #region Properties
    [Browsable(false)]
    [XmlIgnore]
    public Series<bool> BearIndication
    {
       get { return bearIndication; }
    }
    
    [Browsable(false)]
    [XmlIgnore]
    public Series<bool>  BullIndication
    {
       get { return bullIndication; }
    }​
    Given the basic logic above, I'd expect that I could code a custom strategy that uses this indicator's bearIndication or bullIndication values on each bar. I've not yet coded the strategy, I was planning to use the custom indicator in the Strategy Builder to test various conditions before writing a complete strategy with it. The problem is I cannot see it when I go to choose the conditions. I've tried so many things before posting here. Does this custom indicator HAVE to have plots in order to see it in the Strategy Builder? This indicator does use
    Code:
    Draw.ArrowDown(this, "RangeReversal"+currentBarIndex, true, 1, currentHigh + TickSize, Brushes.Red);
    and 
    Draw.ArrowUp(this, "RangeReversal"+currentBarIndex, true, 1, currentLow - TickSize, Brushes.Green);
    to visually indicate the direction however it's not a plot. I do not see ArrowUp or ArrowDown using AddPlot(), the closest I can see is a triangle. So back to the main question. Can I just expose these two Series<bool> variables and then access them in the Strategy Builder as conditions? Or are you actually required to add a plot?

    Thanks in advance,

    Adrian

    #2
    Hello Adrian,

    Thanks for your post.

    Custom NinjaScript indicators will not be accessible in the Strategy Builder if the indicator does not contain a plot and has values assigned to the plot.

    AddPlot() could be used to add plots to the indicator and then you could assign a value to those plots using the Values collection. The value of the plots could then be accessed in Strategy Builder conditions and actions.

    Please see the help guide documentation below for more information and sample code.

    AddPlot(): https://ninjatrader.com/support/help...t8/addplot.htm
    Values: https://ninjatrader.com/support/help.../nt8/value.htm

    Let me know if I may further assist.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Awesome thank you for the reply Brandon. I added a plot as transparent (in State.SetDefaults), so as to not have them show up and that immediately fixed the issue of not showing up in the strategy builder. That gave me the insight for moving forward and I better understand how these parts fit together as a whole.

      All the best.

      Adrian

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      54 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      72 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X