Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Making an indicator signal a public bool

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

    Making an indicator signal a public bool

    Hello Everyone,

    I'm trying to make a bull/bear signal a public bool to call on my strategy. So far i know how to edit my strategy to call on the bool. But I don't know how to edit the indicator to make the bool public, would be grateful for any guidance.

    Thank you,

    Source: https://ninjatrader.com/support/help...alues_that.htm

    #2
    Hello mohdhm,

    Thank you for your note.

    Please see the following post which contains a sample demonstrating hows this can be done.



    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello Alan, Thanks for the link to your script.

      I'm not a good programmer at all so a lot of what the code did went over my head.

      Just wanted to ask if this is the part in the indicator that makes the bool public and referable by the strategy:

      Code:
       #region Properties
      		// Creating public properties that access our internal Series<bool> allows external access to this indicator's Series<bool>
      		[Browsable(false)]
      		[XmlIgnore]
              public Series <bool> GapUp
              {
                  get { return gapUp; }	// Allows our public GapUp Series<bool> to access and expose our interal gapUp Series<bool>
              }
      		
      		[Browsable(false)]
      		[XmlIgnore]		
              public Series < bool> GapDown
              {
                  get { return gapDown; }	// Allows our public GapDown Series<bool> to access and expose our interal gapDown Series<bool>
              }
      		
      	///Setting PlotgapUpPositve1GapDownNeg1Plot series to the 2nd plot, which allows us to reference it in our strategy.
      		[ XmlIgnore()]
      		public Series <double> PlotgapUpPositve1GapDownNeg1Plot
      		{
      		get { return Values[1]; }
      		}
      	
      	///We set this series equal to plot 1 in OnBarUpdate, but are exposing the series so we can use in strategies.
      		[Browsable(false)]
      		[XmlIgnore]		
              public Series < int> GapUpPositve1GapDownNeg1Plot  //Alows us to get the plot series of 1, 0, - depending on gap up, no gap, or gap down.
              {
                  get {return gapUpPositve1GapDownNeg1Plot; }	
      		
              }
      
      
              #endregion

      Comment


        #4
        Hello mohdhm,

        Thank you for your response.

        That is correct. You can see the comment at the beginning of the Properties region that explains this.

        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        66 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        141 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        46 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        51 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X