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 elderan, Today, 08:03 PM
    0 responses
    2 views
    0 likes
    Last Post elderan
    by elderan
     
    Started by algospoke, Today, 06:40 PM
    0 responses
    10 views
    0 likes
    Last Post algospoke  
    Started by maybeimnotrader, Today, 05:46 PM
    0 responses
    9 views
    0 likes
    Last Post maybeimnotrader  
    Started by quantismo, Today, 05:13 PM
    0 responses
    7 views
    0 likes
    Last Post quantismo  
    Started by AttiM, 02-14-2024, 05:20 PM
    8 responses
    169 views
    0 likes
    Last Post jeronymite  
    Working...
    X