Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 r68cervera, Today, 05:29 AM
        0 responses
        2 views
        0 likes
        Last Post r68cervera  
        Started by geddyisodin, Today, 05:20 AM
        0 responses
        3 views
        0 likes
        Last Post geddyisodin  
        Started by JonesJoker, 04-22-2024, 12:23 PM
        6 responses
        35 views
        0 likes
        Last Post JonesJoker  
        Started by GussJ, 03-04-2020, 03:11 PM
        12 responses
        3,239 views
        0 likes
        Last Post Leafcutter  
        Started by AveryFlynn, Today, 04:57 AM
        0 responses
        6 views
        0 likes
        Last Post AveryFlynn  
        Working...
        X