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

Delay in Atm Strategy Entry

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

    Delay in Atm Strategy Entry

    I am trying to convert a strategy into Atm Strategy. I am using AtmStrategyCreate(). There are two problems I am facing.

    Problem 1: There is a few ticks delay in Atm strategy entry. It is entering the trade a few ticks after getting the command. When the volume is low the delay is none or 1. When the volume is high, the delay is usually 2 or 3. Here is a screenshot: https://imgur.com/a/nF07119. As you can see here, the strategy got the command to enter when the price crossed, but it entered 1 tick later. What could be the reason? My Atm strategy has 3 orders in 1 position. I tried using 1 order in 1 position. There was no delay most of the time when the volume was high.

    Problem 2: Sometimes I am getting these yellow pending orders sometimes which cannot be closed. I tried to close it from the chart, chart trader, and control center. But it did not work. The only way to get rid of it is to reset the Sim account. I think problem 1 is the reason behind it. Here's a screenshot: https://imgur.com/a/umdIPox

    #2
    Hi fawzanalim, thanks for posting.

    You will need to wait for 1 tick for the fill to occur. In the simulation fill engine, there are random delays between order states to mimic reality. This is mentioned here:

    https://ninjatrader.com/support/help...simulation.htm

    If the order you showed in the screen shot is stuck it could be from a race condition and it is stuck in a particular state. You will need to reset your Sim101 account to clear the order:
    • From the NinjaTrader Control Center window select the Accounts tab
    • Right click on your simulation account and select 'Edit Account'
    • Press the "Reset" button
    Kind regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      So if I use a real account then there will be no delays?

      I know I can reset the Sim account. But what if I am using a Real account and I can't go to fix it every time during trading hours. Is this happening due to the delay? If yes, is there a fix for it? Like using a different method or something else to avoid the problem.

      Comment


        #4
        Hi fawzanalim, thanks for your reply.

        There is no guarantee the order will fill on the exact tick it is submitted on. With a live account, there is latency through the internet, position in the fill queue, and slippage. I have never seen an order stuck like this on a real account. I have never seen a consistent way to reproduce this and It depends on how your strategy handles orders. We have an example here on advance order management within a strategy:
        https://ninjatrader.com/support/help...and_onexec.htm

        Kind regards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GwFutures1988, Today, 02:48 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        6 responses
        30 views
        0 likes
        Last Post ScottWalsh  
        Started by frankthearm, Today, 09:08 AM
        10 responses
        36 views
        0 likes
        Last Post frankthearm  
        Started by mmenigma, Today, 02:22 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by NRITV, Today, 01:15 PM
        2 responses
        9 views
        0 likes
        Last Post NRITV
        by NRITV
         
        Working...
        X