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

Way to delay entry?

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

    Way to delay entry?

    Hello, maybe this is simple and I’m overthinking it but is there a way to delay the entry of a position when I hit buy or sell? For example- on a 10 minute bar, the bar has 4 minutes left until the bar closes and the new one opens. I decide to go long 4 minutes before the bar closes but do not want to enter the trade until the instant of the next bar open price, not at the current price. Thank you

    #2
    Hi Brandon, thanks for posting.

    Your strategy will need to use boolean flags to mark an entry variable, then if that variable is true on the first tick of the next bar, call the entry method. You can check if the tick is the first tick of the bar with IsFirstTickOfBar, and I have also linked a publicly available page on C# booleans:

    W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.


    The idea is to detect your entry condition, set the boolean to true, and if the boolean is true on the next bar, enter the trade at that time.

    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Pattontje, Yesterday, 02:10 PM
    2 responses
    15 views
    0 likes
    Last Post Pattontje  
    Started by flybuzz, 04-21-2024, 04:07 PM
    17 responses
    229 views
    0 likes
    Last Post TradingLoss  
    Started by agclub, 04-21-2024, 08:57 PM
    3 responses
    17 views
    0 likes
    Last Post TradingLoss  
    Started by TradingLoss, 04-21-2024, 04:32 PM
    4 responses
    44 views
    2 likes
    Last Post TradingLoss  
    Started by cre8able, 04-17-2024, 04:16 PM
    6 responses
    56 views
    0 likes
    Last Post cre8able  
    Working...
    X