Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

liveUntilCancelled in backtesting

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

    liveUntilCancelled in backtesting

    Hello

    I was searching the forum now for quite a while, but could not find any answre to my problem. I am new to NT.

    I wrote a strategy which I test against EOD data.
    I want to use EnterLongLimit, EnterLongStop, ExitLongLimit and ExitLongStop.
    Example:
    I want that the target share is bought at a limit of 160:
    EnterLongLimit(1,160);
    The order always get's cancelled, even the EOD data is several days below 160. I assume that it has to to with liveUntilCancelled parameter. As I understand, the statement above is valid only for the current bar?
    So I tried this:
    EnterLongLimit(0,true, 1, 160,"test")
    It also does not work. because of barsInProgressindex?

    1. Could you explain me how I have to code that I can submit an order lasting several days until it is fulfilled or cancelled?

    2. What is the meaning of the barsInProgressIndex? At point t I can only reference bars of t or earlier. How is this then applied?

    Thanks for your help
    Andre

    #2
    Andre, welcome to NT. For those issues, you should add TraceOrders = true in your Initialize() and then open the output window to debug the order behavior -



    BarsInProgress can be used to filter which bars object is calling the OnBarUpdate() in a multiseries strategy context -



    Depending on how you structured your script you'll likely be running into the Internal Order Handling Rules with this approach -

    http://www.ninjatrader-support.com/H...verview36.html (bottom section of this link).

    The TraceOrders features would help diagnose this.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand

      Thanks for your feedback. The problem was the same as in my other post. When use default or libaral filltype it works fine.

      As I understand you do not offer the possibility to execute on the day of the order generation. As others which asked for this feature I am generating a signal per week and buy at the same day. It would be very helpful to have this option, maybe you consider to introduce it with the restriction that it can be used only on daily or weekly bars?

      regards
      Andre

      Comment


        #4
        Thanks for the feedback - it sounds like you would need to submit the order then to a finer frame -

        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
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pechtri, 06-22-2023, 02:31 AM
        10 responses
        124 views
        0 likes
        Last Post Leeroy_Jenkins  
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Yesterday, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Yesterday, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Yesterday, 03:01 PM
        2 responses
        22 views
        0 likes
        Last Post helpwanted  
        Working...
        X