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 PhillT, 04-19-2024, 02:16 PM
        4 responses
        34 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Started by ageeholdings, 05-01-2024, 05:22 AM
        5 responses
        37 views
        0 likes
        Last Post ageeholdings  
        Started by reynoldsn, Today, 02:34 PM
        0 responses
        12 views
        0 likes
        Last Post reynoldsn  
        Started by nightstalker, Today, 02:05 PM
        0 responses
        18 views
        0 likes
        Last Post nightstalker  
        Started by llanqui, Yesterday, 09:59 AM
        8 responses
        31 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Working...
        X