Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trade orders; fix stop to specific entry

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

    Trade orders; fix stop to specific entry

    Hi,

    I'm looking for the easiest way to fix any specific exit order to an entry order, for the formation of NT's order pairing in it's trades-reporting.

    Specifically I need to perform the following (backtesting functionality):

    1. Buy at the open of Daily bar, and/or on a limit price.
    2. Have a stop order for each entry that may trigger on the same (entry) bar, or later bars.
    3. When a stop is hit, it should create a trade that references it's corresponding entry order, and not the first open entry. *

    * This will often be the last entry, if using fixed sized stops. So linking last exit to last entry will be helpful. But ideally, to work for variable stops, it should link to specific entry order.

    I can use unmanaged mode, or 3rd party, e.g. LOM, if needed. Hard coding orders is also acceptable if this function exists. Just looking for simplest solution at the moment that allows for controlling the trade "pairing".

    Note this need not to work for live trading, as it is currently for statistical purpose.
    Last edited by bretddog; 10-27-2013, 03:44 AM.

    #2
    Hello Bretddog,

    Thank you for your post.

    You can use the FromEntrySignal string to call the SignalName used for the entry orders. This is available in the Strategy Analyzer for each order under Signal Name and From Signal Name.

    For information on each order type in the Managed Order Approach (Enter() methods) please visit the following link: http://www.ninjatrader.com/support/h...d_approach.htm

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

    Comment


      #3
      Thanks Patrick!

      It's still unclear to me how to make a stop order working within the entry-bar.

      For example:

      EnterLong(1, Time[0].ToString());
      ExitLongStop(Open[0] - 20, Time[0].ToString());

      With this no stop is ever triggered. Am I correct to assume this methodology is not correct, because Open[0] refers to current bar, while EnterLong and ExitLongStop only is activated for the next bar, so Open[0] will not be entry price ?

      Still, if it's like that, why is no stop triggered, even if using wrong Open price?

      How would I correctly achieve a stop working on the entrybar?

      Comment


        #4
        For strategies add TraceOrders = true to your Initialize() method and you can then view valuable output related to strategy submitted orders through Tools > Output window - TraceOrders

        This should tell is if the order is being ignored for any reason.

        For further debugging to determine why the stop is not triggered, where exactly are you calling the stop from? Is it in OnBarUpdate? It could be if you're backtesting that OnBarUpdate is triggered at the close of the bar and the open is not what you expect, however reference to this price really depends when then stop is being called...

        If you were not aware, please also review our reference sample on Using OnOrderUpdate() and OnExecution() methods to submit protective orders

        The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by TraderBCL, Today, 04:38 AM
        2 responses
        7 views
        0 likes
        Last Post TraderBCL  
        Started by martin70, 03-24-2023, 04:58 AM
        14 responses
        105 views
        0 likes
        Last Post martin70  
        Started by Radano, 06-10-2021, 01:40 AM
        19 responses
        606 views
        0 likes
        Last Post Radano
        by Radano
         
        Started by KenneGaray, Today, 03:48 AM
        0 responses
        4 views
        0 likes
        Last Post KenneGaray  
        Started by thanajo, 05-04-2021, 02:11 AM
        4 responses
        471 views
        0 likes
        Last Post tradingnasdaqprueba  
        Working...
        X