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

Execution in Tick X Tick Mode

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

    Execution in Tick X Tick Mode

    I have a strategy that triggers a Long entry when the live bar's last trade exceeds the prior bars' high (there are more qualifications concerning the last 3-4 bar patterns)...

    The strategy is set to
    CalculateOnBarClose =
    false;
    but seems to be entering trades on the bar AFTER the trigger is tripped. In other words, the order is not entered until the 'trigger' bar is closed.

    Are there more requirements other than specifying
    CalculateOnBarClose =
    false;?
    -------------------------------------------------------------------
    Also, in tickxtick mode (vs. OnBarClose mode) if I want to enter a trade when the Last price is higher than the prior bar high, is there a difference between these 2 snippets?:

    A) if(Close[0] > High[1])
    -----EnterLong...
    B) if(High[0] > High[1])
    -----EnterLong...
    ----------------------------------------------------------
    One last potential cause---are orders submitted differently (at different times) under
    CalculateOnBarClose = false;
    vs.
    CalculateOnBarClose = true;?
    Jim-Boulder
    NinjaTrader Ecosystem Vendor - Elephant Tracks

    #2
    1st Issue - Orders should be submitted immediately. You can test on a 60 min bar runing tick by tick with code something like this -

    if (Historical) return;
    if (Volume[0] > 100) EnterLong();

    The above should fire off a market withing a few minutes if not seconds prior to the 60 minute duration completion.

    2nd Question - The two are very different since tickbytick, Close == High many times.
    RayNinjaTrader Customer Service

    Comment


      #3
      Clarification

      Thanks Ray.

      Let me ask it this way: Given that I want to submit a Long Entry order as soon as the last trade exceeds the PRIOR bar's high, which is the best way to do that?

      Since there is no such thing as Last price (right?)..I assumed the "Close[0]" would be the last trade in tick x tick mode.

      Let me make sure I can explain your last point...is it that once High[0] > High[1] is true then it would continue to be true for every tick thereafter for the bar in progress, while Close[0] > High[1] would only be true on ticks where this was true?

      Here's a related question. Given tick x tick mode, how do I avoid re-executing the LongEntry order again while I am "waiting" for the original order to be executed? Currently, I check to make sure marketposition is flat and then check to see if the triggering events have occurred. However, in the tick x tick mode isn't it likely that the triggering events could be true (on the next few ticks) AND the original entry order not be executed yet (thus I am still flat)--and this could continue for several ticks?
      Jim-Boulder
      NinjaTrader Ecosystem Vendor - Elephant Tracks

      Comment


        #4
        Close is equal to last trade.

        In real time tick by tick -

        Close[0] > High[1] will give you the same result as High[0] > High[1]

        In a backtest it will not. The reason is...in real-time tick by tick, High[0] is at some point in time equal to Close[0] since Close[0] represents the last traded price.
        RayNinjaTrader Customer Service

        Comment


          #5
          Strategy Plots differently on Historical Vs Real Time?

          Do strategies plot differently on historical data vs. real time?

          In Tick X Tick mode, in real time the trades execute on the live bar properly, but on all the trades to the left on the chart (historical) the trades are plotting on the bar following the bar that should have triggered the trade. It is as if on historical data, the trades are waiting for the bar to close and if the trade was triggered it then enters it. Is this the proper behavior?

          If not, any ideas why this would be happening?
          Jim-Boulder
          NinjaTrader Ecosystem Vendor - Elephant Tracks

          Comment


            #6
            Trades are plotted based off the time stamp of the execution. It will find the first bar on the chart with the corresponding time.
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by lightsun47, Today, 03:51 PM
            0 responses
            4 views
            0 likes
            Last Post lightsun47  
            Started by 00nevest, Today, 02:27 PM
            1 response
            8 views
            0 likes
            Last Post 00nevest  
            Started by futtrader, 04-21-2024, 01:50 AM
            4 responses
            44 views
            0 likes
            Last Post futtrader  
            Started by Option Whisperer, Today, 09:55 AM
            1 response
            13 views
            0 likes
            Last Post bltdavid  
            Started by port119, Today, 02:43 PM
            0 responses
            8 views
            0 likes
            Last Post port119
            by port119
             
            Working...
            X