Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orders submit at incorrect time and no chart displayed.

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

    Orders submit at incorrect time and no chart displayed.

    I am having problems getting to the bottom of problems with my new strategy.

    Looking thou the logs I can see that it is submitting orders at 8.30 when It should be submitting the orders at the open, 8.00.

    Here is the log entry,

    A BuyToCover stop order placed at '14/02/2013 08:30:00' has been ignored since the stop price is less than or equal to the close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.

    Here is some of my OnBarUpdate,

    protected override void OnBarUpdate()
    {
    if(CurrentBars[1] <= 1)
    return;

    if(CurrentBars[1] == null)
    return;

    if(BarsInProgress != 0)
    return;

    // If there is a new session add one to session count.
    if(Bars.SessionBreak)
    sessionCount++;


    and my order submition is :-

    if(Bars.FirstBarOfSession)
    {
    if(EMA(fEMA)[0]>EMA(sEMA)[0]) // LONG ENTRYS
    {
    if(Open[0] > pp && Open[0] < r1)
    {
    longEntryPP = EnterLongLimit(0,true, 1,pp + entryAllowance * TickSize , "Long Entry PP");
    }

    Also when I enable the strategy I see nothing on the chart it is enabled on?

    #2
    Hi GKonheiser,

    Thank you for your post.

    What instrument are you working with?

    I would try using a time filter instead of the first bar of session.
    I have attached a link on how to apply a time filter to your strategy -
    http://www.ninjatrader.com/support/f...ead.php?t=3226
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Looking at FGBL 03-13 at the moment, opens at 0800 CET.

      Shouldn't the on Bars.FirstBarOfSession submit the order at the beginning of the first bar?

      I tried if(ToTime(Time[0] == 80000)); but get error

      Operator '==' cannot be applied to operands of type 'System.DateTime' and 'int'

      Comment


        #4
        Hi GKonheiser,

        Thank you for the information.

        I am seeing the FGBL being set to UTC +1:00 for when the time starts which would be 2 AM Central Time.

        Did you switch the Time Zone for the instrument?

        Additionally, you would want to use the closing parenthesis around the (ToTime(Time[0]) == 080000)

        Lastly, the FGBL is currently on the 12-13 contract. Did you mean to say 03-14?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Hi

          I am near Vienna, so CET so it starts at 0800 my time. If that's what your asking?

          I am testing my code on historical data, hence FGBL 03-13. Can you think of why the orders would not be submitted until 8.30? I running the strategy on a 5 Min chart which makes it even stranger.

          I just tried the code using the time filter for 080000 and it is entering during the day not just at 0800??
          Last edited by GKonheiser; 10-28-2013, 09:19 AM.

          Comment


            #6
            GKonheiser,

            Would you be willing to send me your script so I may test this on my end?

            You can send the script to support[at]ninjatrader[dot]com with ATTN Cal in the subject and a reference to this post in the body.
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              Hi Cal

              On its way.

              Comment


                #8
                GKonheiser,

                There is a semi-colon at the end of your Time if statement that is preventing the code from being read in the condition for your entries. Please remove this and you will see the trades only take place at the time you set.

                Let me know if I can be of further assistance.
                Cal H.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks very much. its slowly getting there.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  670 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  379 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  111 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  575 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  582 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X