Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SampleBoolSeriesStrategy

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

    SampleBoolSeriesStrategy

    Hi,

    Is it necessary to have the line of code below included the script when you are calling an indicator?

    Code:
    [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]
    Print(SampleBoolSeries().ExposedVariable);
    [/SIZE][/FONT][/SIZE][/FONT]
    Alternatively, can we have it "printing" without it showing in the output window?

    Regards

    Kay Wai

    #2
    Kay, can you please clarify? You don't need that line unless you are trying to get the ExposedVariable, and you don't need to print it either unless you want to.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Hi Austin,

      I compare the current close with the close of a few bars ago. I guess I would need it then.

      But if I don't want to print it, how do i get the exposedvariable to update or does it update automatically?

      Just an update. I omitted the "Print Exposed Variable" line and my strategy had zero trades. When included, I have trades executed.

      I just don't want to have the exposed variable printed in the output window. Can you please help? The code below is what I use:-

      Code:
      [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]
      Print(Times[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]][[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]]);
      Print([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"tdbuyextendedsetup"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] + TDBuyExtendedSetupFXwithCOBCfalse().ExposedVariable);
      Print([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"tdsellextendedsetup"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] + TDSellExtendedSetupFXwithCOBCfalse().ExposedVariable);
      [/SIZE][/FONT][/SIZE][/FONT]


      Regards

      Kay Wai
      Last edited by kaywai; 07-24-2011, 07:36 PM.

      Comment


        #4
        Kay, please check the Properties section of the indicator that you're trying to access the exposed variable from, does this include the needed call to Update() in the property getter then?

        Comment


          #5
          Yes, it does Bertrand.

          Comment


            #6
            Hello,

            You do not need to have the variable Printing to update it. It will update on his own with no need to print it. If its not updating then you have a another issue going on we would need to troubleshoot.

            Please make sure you do not have Calculate On Bar Close set in the Initialize for both indicators and the referenced indicator as this will cause strange issues.

            I look forward to assisting you further.
            BrettNinjaTrader Product Management

            Comment


              #7
              Hi Brett,

              I need to have CalculateOnBarClose in my code.

              I have indicators and strategies which are both set to COBC = false

              I also have indicators and strategies which are both set to COBC = true.

              This is to ensure consistency between the indicator and strategy used.

              It's a smallish code. I'm happy to email it to you if you like though you may have to "cut and paste" the code as Yahoo thinks the code is a virus!

              Regards

              Kay Wai

              Comment


                #8
                Hello there, did you send in a note with your instrument earlier? Could you please resend it to support at ninjatrader dot com with 'Attn Austin - ticket 519212' in the subject? If you have to copy + paste it, make sure you expand all of the [+] boxes so you copy the entire code. Thank you.
                AustinNinjaTrader Customer Service

                Comment


                  #9
                  Hi Austin,

                  I've just sent it.

                  Best Regards

                  Kay Wai

                  Comment


                    #10
                    Kay, going back, what is the issue here? Are the values not updating correctly? You don't need to print the exposed value for it to update, your scripts have the Update() method included, so everything should be functioning just fine.
                    AustinNinjaTrader Customer Service

                    Comment


                      #11
                      For some quirky reason, if i don't include the exposedvariable in the strategy code, the strategy generates zero trades but when included, trades are generated.

                      I just wanted to know how I do away with the exposed variable prints in the output window.

                      Regards

                      Kay Wai

                      Comment


                        #12
                        Would need you to send code that reproduces this not updating to support at ninjatrader dot com as this is not expected. You should not have to print.

                        Please send this in and we will look into this for you with development.

                        Thank You.
                        BrettNinjaTrader Product Management

                        Comment


                          #13
                          Hi Brett,

                          I'm not sure what you mean. I've emailed the codes - indicator and strategy - to NT support a few days ago.

                          support at ninjatrader dot com with 'Attn Austin - ticket 519212' in the subject

                          Regards

                          Kay Wai

                          Comment


                            #14
                            Hi Kay, I was able to reproduce this issue. I'll send your script in to development and see what they have to say. As a quick workaround, you can comment out the print lines, and just assign the values to a holder variable.
                            Code:
                                        //Print(Time[0]);
                                        //Print("tdbuyextendedsetup" + TDBuyExtendedSetupFX().ExposedVariable);
                                        //Print("tdsellextendedsetup" + TDSellExtendedSetupFX().ExposedVariable);
                                        string buySetupHolder = TDBuyExtendedSetupFX().ExposedVariable.ToString();
                                        string sellSetupHolder = TDSellExtendedSetupFX().ExposedVariable.ToString();
                            AustinNinjaTrader Customer Service

                            Comment


                              #15
                              Kay, if you're trying to access a variable in another indicator, you need to set that variable in a data series. The script you're using now just sets a bool variable to true/false, and that wouldn't be updated unless explicitly called. Please change everything over to a boolean data series and let me know if the problem persists. I'm sure you've seen the "exposing a variable" reference sample but if you haven't, here it is - http://www.ninjatrader.com/support/f...ead.php?t=4991.
                              AustinNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              650 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              370 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              109 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              574 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              577 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X