Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit

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

    Exit

    2 data series , data0 is 30minutes, data1 is 5minutes, data1 did not ExitLong on time, it ExitLong few bars(data1) late .
    code :

    if (BarsInProgress != 0)
    return;​

    if
    (Lows[1][0] < Lows[1][1])

    {
    ExitLong(100, "exitS32m", "S32m");
    }​
    Last edited by bill2023; 06-20-2023, 04:34 AM.

    #2
    Hello bill2023,

    The way that is coded the code is only executed every 30 minutes, are you expecting to have that code executed at the 5 minute interval?

    Comment


      #3
      instead, you could do it like this:

      Code:
      if (BarsInProgress == 1 && Lows[1][0] < Lows[1][1])
      {
      ExitLong(100, "exitS32m", "S32m");
      }​​
      That way, it would only process your code if BarsInProgress == 1 and not if BarsInProgress == 0.

      Comment


        #4
        Hello bill2023,

        If you expected the logic to be executed for the secondary series you can do what UltraNIX said but you do need to remove the following line of code if you do that:

        if (BarsInProgress != 0)
        return;​​

        This code prevents the secondary series from executing the code below that line, the way your code is now it would only be executed for the primary series.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        45 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        21 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        31 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Working...
        X