Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetCurrentAsk Question through NT

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

    GetCurrentAsk Question through NT

    I have a question concerning my use of the getcurrentask as a condition before submitting an order.

    The line reads:
    && (GetCurrentAsk()) * (1 + -0.0025) <= (Bollinger(Low, 1.5, 10).Lower[0]) * (1 + -0.055))

    As one of my conditions before submitting an order. I have an institutional 100 symbol only subscription to eSignal. I was wondering if this line will be satisfied at some point.

    Basically, it is to submit the order if the 0.25% or 0.0025 less than the current ask is less than the 5.5% less than the 10,1.5 bollinger band. Is this a correct method?

    Do I even have access to the ask price with this subscription? A lot of orders should have been submitted today and none were. Can you comment about this?--

    Beau
    Last edited by beauw; 10-02-2008, 04:03 PM.

    #2
    I guess I should mention I am running this on a daily series in real time, and check the getcurrentask on each tick...I think. Let me know if it doesn't work this way.--Beau

    Comment


      #3
      Hi Beau,

      If you want to check against each tick please ensure you are running your strategy with CalculateOnBarClose = false.

      From a pure mathematically standpoint your condition should be fine, but you need to debug your strategy as per this tip: http://www.ninjatrader-support.com/v...ead.php?t=3418

      You will want to print out all the values and run your calculations by hand to see if your conditions were ever really true.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        I was aware of the calculate on Barclose, already, but I keep getting this message.
        ---------------------------
        Error
        ---------------------------
        NinjaTrader has detected a problem and needs to shut down. Information has been written to the trace file.
        Please restart NinjaTrader and send us an email via Help > Mail to Support and include information on how you may have encountered this problem.
        This email will automatically embed relevant trace file information to help us diagnose the problem.
        ---------------------------
        OK
        ---------------------------
        When I try to change the strategy setting to a stock when inserting a strategy into the strategies tab.

        The log posts this message:
        ########Default
        10/2/2008 18:55DefaultError on setting property 'Account' for strategy 'SuperBandsBacktest': Object reference not set to an instance of an object.

        Comment


          #5
          Please take a look at this tip: http://www.ninjatrader-support.com/v...ead.php?t=4226
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            I really don't understand how to do that.

            It reads to declare an iorder variable, but doesn't explain what to do if the iorder is not null, because I will ten average down positions. And I guess it's easier for you guys to edit the code, because all I know is the wizard.

            Comment


              #7
              I don't understand how to implement that through the wizard. I'm going to e-mail the program to support ticket Support request (6.5.1000.6/Microsoft Windows NT 5.1.2600 Service Pack 3) {87752}.

              The file is too big to send through this forum. Please edit the program with the iorder method. I really don't see what I'm supposed to do with it in the case of 10 entries and 1 exit.

              Comment


                #8
                Hi beauw,

                To clarify, your strategy was created through the Strategy Wizard? Also, you should be able to attach your strategy here on the forums. Please use the File->Utilities->Export NinjaScript to save out your strategy and upload it here.

                Unfortunately we do not do custom programming. We can help work through your problem here, but we cannot program your strategy for you. However you can try one of our 3rd party NinjaScript Consultants here: http://www.ninjatrader.com/webnew/pa...injaScript.htm
                Thank you for understanding.
                Last edited by NinjaTrader_JoshP; 10-03-2008, 07:59 AM.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  protectedoverridevoid OnBarUpdate()
                  {
                  // Condition set 1
                  if (Open[0] >= (Bollinger(Low, 1.5, 10).Lower[0]) * (1 + -0.055)
                  && LinReg(
                  10)[0] >= (Bollinger(Low, 1.5, 10).Lower[0]) * (1 + -0.055)
                  && StdError(
                  3).Middle[0] >= N
                  && (GetCurrentAsk()) * (
                  1 + -0.0025) <= (Bollinger(Low, 1.5, 10).Lower[0]) * (1 + -0.055))
                  {
                  }

                  Comment


                    #10
                    The file is too big to post here. And I just got a new message in my log files. I still get object reference no set to an instance of an object. And I got an error on calling onbarupdate method for the strategy. Limit price has to be greater/equalU Paramenter name value.

                    Oh, and did I mention, all of the changes that I made attempting to implement the iorder method in the thread you referenced were lost. I compiled and it said it generated the strategy succesfully. I went back to check the code, and it hadn't changed.

                    // Wizard generated variables
                    privatedouble n = 0; // Default setting for N
                    // User defined variables (add any user defined variables below)
                    #endregion
                    ///<summary>
                    /// This method is used to configure the strategy and is called once before any strategy method is called.
                    ///</summary>
                    protectedoverridevoid Initialize()
                    {
                    Add(Bollinger(Low,
                    1.5, 10));
                    Add(LinReg(
                    10));
                    CalculateOnBarClose = false;
                    }

                    Is how I initialized the program

                    Comment


                      #11
                      My understanding is to declare:
                      private iOrder entryorder=null; in the private variables

                      I was then going to insert the following into the blank {} bars following the true entry conditions. Have I interpreted this correctly?
                      {
                      if (entryOrder == null)
                      entryOrder = EnterLong();

                      else if (entryOrder != null)
                      {
                      if (entryOrder.Filled > 0)
                      // Do something
                      }
                      }

                      When I did that, after we see if that's what you're explaining, I was going to add 11 of those iorder variables. That is, 10 for entries, and 1 for the exit.

                      At the beginning of the program if the exit was filled I was going to declare all the variables null to reset them. Is this correct?

                      I'm not paying 100's of dollars to pay someone for something I can do myself. You're probably the only support forum that doesn't work with code.

                      Comment


                        #12
                        beauw,

                        When you export the NinjaScript it should not be too large unless you have thousands upon thousands of lines of code. Instead of trying to copy+paste the code into a post, please use the File->Utilities->Export NinjaScript feature and attach it as a file attachment.

                        Disregard the IOrder reference right now. Please export the strategy in its original state and I will take a look. Thank you.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          This is what I'm working with. The backtest version works correctly, and the only difference is that getcurrentask line in the real time version. Let me know what you think.--Beau
                          Attached Files

                          Comment


                            #14
                            beauw,

                            I cannot reproduce any errors with your strategy on my end. Your original error message was in reference to SuperBandsBacktest. Please attach that strategy. Thanks.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              Josh, exactly my point, the program is fine. I still get errors when changing over to a stock to automate this strategy on. I either don't have a working version of NT to work with collective2 on, or something is wrong with the database. I received a request to rename the Ninjatrader database OldNinjaTrader.MDB, and I still have this problem.

                              Can we figure something out?

                              I'm going to explain the sequence. I connect to esignal. I go to the strategies tab and I hit new strategy. When I attempted to change the default instrument to "STOCK" it gives me that error message.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by maybeimnotrader, Yesterday, 05:46 PM
                              3 responses
                              23 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by adeelshahzad, Today, 03:54 AM
                              5 responses
                              32 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by stafe, 04-15-2024, 08:34 PM
                              7 responses
                              32 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by merzo, 06-25-2023, 02:19 AM
                              10 responses
                              823 views
                              1 like
                              Last Post NinjaTrader_ChristopherJ  
                              Started by frankthearm, Today, 09:08 AM
                              5 responses
                              23 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Working...
                              X