Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Assistance with exit strategy using intra day data

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

    Assistance with exit strategy using intra day data

    I am struggling to achieve what seems like a relatively simple task:

    If yesterday's close is above EMA I want to enter long at the open and exit on the close of the same day.

    From what I gather I need to use intra day data. I have followed the example below:

    You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


    But the problem I am getting is that the exit price is from the previous bars close rather than the current bars close.

    Any suggestions would be much appreciated.
    Attached Files

    #2
    Hello Beach01,

    Using the Strategy Analyzer it is going to process your Strategy with Calculate On Bar Close true, so that mean once all of your conditions are your Strategy is going to enter the market at the open of the next bar.

    With your Exit condition looking at a Minute Time-frame most instruments will have an overnight session that is going to be triggering to Exit your Position when you are not wanting it to. You may want to change your time frame between a time period so that you can better close out of your position before the new session starts for example:

    Code:
    if (enteredLong && 
         ToTime(Times[1][0]) <= 160000 && ToTime(Times[1][0]) >= 155500)	
    
    ExitLong();
    Let us know if that works better for you.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    579 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X