Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi timeframe stop loss level

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

    Multi timeframe stop loss level

    Hi,

    I am coding a system which checks setup conditions on 15-minute (BarsArray[0]) but opens and manages position on 5-minute (BarsArray[1].

    Please find the screenshot attached which shows few opened and closed positions.

    Please check first two positions:
    - 83 333 @ 1,2691 - entry time 15:50 exit time 16:00
    - 83 333 @ 1,2690 - entry time 16:00 exit time 16:00

    15:50 5-minute bar is a bar with long upper tail with its high at above 1,2710. This bar is a part of 16:00 15-minute bar.

    I see here that second position was opened at 16:00 but closed at 15:50 which means that stop loss level is associated with 15-minute time frame and not with 5-minute time frame. Am I right?

    Is this expected behavior on backtest?
    Attached Files

    #2
    Hello kucharek,
    Originally posted by kucharek View Post
    - 83 333 @ 1,2690 - entry time 16:00 exit time 16:00

    I see here that second position was opened at 16:00 but closed at 15:50 which means that stop loss level is associated with 15-minute time frame and not with 5-minute time frame. Am I right?
    The second position was opened at 16:00 and was closed on the same bar only.

    Please send me your log and trace files for today so that I may look into what occurred.

    You can do this by going to the Control Center-> Help-> Mail to Support.

    Please reference the following ticket number in the body of the email:665034

    I look forward to assisting you further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi,

      I have send Mail to Support. Looking forward to hearing from you.

      Comment


        #4
        Hello,
        I replied to your email yesterday. Did you received it?

        I am reproducing the content of the email below.

        Both the five minute bar series and the 15 minute bar series updates at 16:00. Thus if the orders are exited at 16:00 it is not an anomaly.


        To be sure, you can further filter your code with the BarsInProgress property.

        if (BarsInProgress == 1) //when 5 minute bars updates

        {

        //entry and exit codes

        }



        Please refer to this sample code which demonstrates how to enter on one timeframe and exit on another timeframe.





        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Hi.

          Thank you for your feedback. I did not receive your e-mail.

          I have filtered the code using BarsInProgress property.

          Please find below my code regarding BarsInProgress == 1 (5-minute). This is the only code regarding 5-minute time frame in the strategy.

          Code:
          if (BarsInProgress == 1 && High[0] >= poziom_C && nizszy_TF)
          {
          PozycjaSHORT();			
          EnterShortStop((int)PsizeSHORT, Lows[1][0] - 1 * TickSize, "EntryShort");
          SetStopLoss("EntryShort", CalculationMode.Ticks, (int)StoplossSHORT, false);
          SetProfitTarget("EntryShort", CalculationMode.Ticks, tp_short * (int)StoplossSHORT);
          Please note that "Entries per direction" is set to 1. Also, I am entering and exiting position only in 5-minute time frame. I do not use 15-minute for managing positions.

          Please note that 16:00 5-minute bar does not reach 1,2702 price level so it shall not be possible to close this position on that bar. Also, it looks like I have more than one position opened at the time which shall also not be possible.

          Please clarify and support? What I could do wrong?

          P.S. Please find attached second example which shows 2 positions being active at the same time.
          Attached Files

          Comment


            #6
            Hello kucharek,
            Unfortunately the code snippet is not enough and I need a bit more information.

            Please send a toy code* to support[AT]ninjatrader[DOT]com depicting the scenario.

            Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

            I look forward to assisting you further.

            *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              Hi,

              Thanks. I have just send you an e-mail.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by JoMoon2024, Today, 06:56 AM
              0 responses
              6 views
              0 likes
              Last Post JoMoon2024  
              Started by Haiasi, 04-25-2024, 06:53 PM
              2 responses
              19 views
              0 likes
              Last Post Massinisa  
              Started by Creamers, Today, 05:32 AM
              0 responses
              6 views
              0 likes
              Last Post Creamers  
              Started by Segwin, 05-07-2018, 02:15 PM
              12 responses
              1,786 views
              0 likes
              Last Post Leafcutter  
              Started by poplagelu, Today, 05:00 AM
              0 responses
              3 views
              0 likes
              Last Post poplagelu  
              Working...
              X