Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry before Exit in multi timeframe strategy

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

    Entry before Exit in multi timeframe strategy

    Hi all,

    I`ve searched this forum for an answer to my question but I still haven`t figured it out. I hope somebody can help.

    I developed a strategy that runs on 5 min Bars.Wihtin the code I added a second bar seris (1 day bars).

    Here`s a piece of the code:


    Add(PeriodType.Day, 1);

    // Condition set: LONG ENTRY
    if ( Some conditon based BarsArray[1] data) )
    {
    EnterLongLimit(DefaultQuantity, Close[0]*(1-Buylimit), "");

    }


    So, strategy runs on 5 min bars (set in the strategy window, primairy serie), while it continiously looks at 1 day Bar data (second serie). Oder entry is via limit order on the 5 min bar series (triggered if 1 Day bar serie conditions are true).

    The trade results show exits before entry or both at the same time.
    Also, the trade markers are all positioned at one time per day (but they do seem to indicate the correct price levels, just at the incorrect time).
    All trades are ended via EXITONCLOSE setting in strategy tab.

    I noticed that once I add trailingstop order (also on the 5 min bars) and the target is hit that the chart markers will be correct time wise but the Trades Tab still shows exits before entries.

    I have 2 questions about this:
    1) Any idea what`s causing this?
    2) What would happen if traded to a live account? At what time would the trades be entered and exited?

    Hope this is clear, also please see the screenshot.
    Happy to provide any more info if required as I really want to understand this.

    Michel

    PS...CalculateOnBarClose is set to true...Setting it to False gives same result.

    Thanks.

    Michel
    Attached Files

    #2
    Hello majansen,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    This is likely due to the executions occurring on the Daily bar rather than the 5 minute bar. Please try using the BarsInProgress Index for the Enter() method. For example:
    Code:
    EnterLongLimit(0, true, DefaultQuantity, Close[0]*(1-Buylimit), "");
    This would be the following syntax: EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName)

    For more information please visit the following link: http://www.ninjatrader.com/support/h...nstruments.htm

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,789 views
    0 likes
    Last Post aligator  
    Started by Jimmyk, 01-26-2018, 05:19 AM
    6 responses
    837 views
    0 likes
    Last Post emuns
    by emuns
     
    Started by jxs_xrj, 01-12-2020, 09:49 AM
    6 responses
    3,293 views
    1 like
    Last Post jgualdronc  
    Started by Touch-Ups, Today, 10:36 AM
    0 responses
    13 views
    0 likes
    Last Post Touch-Ups  
    Started by geddyisodin, 04-25-2024, 05:20 AM
    11 responses
    63 views
    0 likes
    Last Post halgo_boulder  
    Working...
    X