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

returning non plotted series

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

    returning non plotted series

    Hi

    I want to write an indicator that does some plots but also returns a flag -2, -1, 0, 1, 2 ... so i have n line plots plus a series that is available but not plotted. I would want to look at the plotted and non plotted values in a strategy

    Could somebody explain how i do that

    much appreciated ...

    Thanks

    #2
    You could for example set your 'signals' to a non plotted series variable that is exposed to be accessed then from your strategy, the sample following shows how to work this with BoolSeries, but others would work as well -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      great - thanks very much ....

      Comment


        #4
        Originally posted by NinjaTrader_Bertrand View Post
        You could for example set your 'signals' to a non plotted series variable that is exposed to be accessed then from your strategy, the sample following shows how to work this with BoolSeries, but others would work as well -

        http://www.ninjatrader.com/support/f...ead.php?t=4991
        This is very helpful, but having limited prgramming skills, following questions arise:

        1. 'exposedVariable' is declared in the indicator and the strategy has
        'Print(SampleBoolSeries().ExposedVariable'

        How/where does 'exposedVariable' get linked to the SampleBoolenSeries?

        2. I fI were not intereseted in a booleanSeries, couldn't I just use a boolen exposedVariable?

        3. Ideally I would like to return a variable from an existing indicator and use that in a strategyWizard - is that possible?

        I have had sucess with changing ZigZag indicator parameters whithin the code which cause the indicator to plot zigzig lines in 2 different colors - it is just a boolean, and I want to use within the strategy wizard, but no luck so far.

        Appreciate the help and thnks.
        Kumar

        Comment


          #5
          Hello,

          1- I should be set at the top in or near the variables section.
          2- I am sorry, I don't understand. Yes, you can use a simple boolean variable that toggles from true to false, but the series part is so you can access it in history.
          3- You can access indicator values in the Wizard, but the ZigZag is not like other indicators. It is very difficult to access programmatically, let along via the Wizard. The ZigZag and Swing inidcators are for visual use only.
          DenNinjaTrader Customer Service

          Comment


            #6
            Ben,

            Here is what I am thinking:

            1. Variables:
            private
            bool swingfound (= false)

            2. Properties:
            publicbool foundswing
            {
            get { Update(); return foundswing; }
            }
            3. In indicator NinjaPriceAction in the logic to plot HH, HL, ... set the variable to true or false as appropriate.

            How can I make this variable available in strategy wizard? I am only interested in the current value and not the history, so would not need to define a boolen series (that is what you have implied).

            Thanks.
            Kumar

            Comment


              #7
              Kumar, you will have to expose whatever series you're working with in order to use it in the Strategy Wizard. A quick side note: capitalization is very important when exposing variables because there is a private variable internal to the indicator and a public variable (the exposed one) that can easily be mixed up.

              To further answer your question #1 in post 4, the exposed variable is accessed by the strategy that is also a part of the reference sample. Please take a look at post 4 in this post as well - I've explained it in a bit more detail there.
              AustinNinjaTrader Customer Service

              Comment


                #8
                Thanks Ben, Sorry my confusion prevails!
                Two posts ago NT_Ben wrote:
                "2- Yes, you can use a simple boolean variable that toggles from true to false, but the series part is so you can access it in history."
                So if I don't need the history, why do I need to define a boolean series?
                I read through this thread and noticed that Larry had the same issue - am I to conclude that it is essential to define a boolean series?
                And if I do that, will I have access to it through the strategy wizard?
                Also, thanks for pointing out the significance of capitalization, duly noted.
                Thanks for the patience.
                Kumar

                Comment


                  #9
                  kumar, you can expose either a boolean variable or boolean series - however to allow for
                  backesting through the wizard / Strategy Analyzer you would then indeed need the series.
                  BertrandNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by techgetgame, Yesterday, 11:42 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post techgetgame  
                  Started by sephichapdson, Yesterday, 11:36 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post sephichapdson  
                  Started by bortz, 11-06-2023, 08:04 AM
                  47 responses
                  1,613 views
                  0 likes
                  Last Post aligator  
                  Started by jaybedreamin, Yesterday, 05:56 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  20 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Working...
                  X