Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exits with Multi Time Frame

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

    Exits with Multi Time Frame

    First my Primary is Renko and my Secondary are 1 Minute (first) and 20 Seconds (Second additional data series)
    Strategy is running OnBarClose - my preference with indicators etc

    currently in the Strategy Builder but can unlock the code if necessary

    Goal to exit with the trigger from the 20 second bar Close while current prints are intrabar of the current Renko Bar

    // Set 40
    if ((Position.MarketPosition == MarketPosition.Long)
    && (LongTrades == true)
    && (BarsSinceEntryExecution(0, "", 0) >= 0)
    && (Closes[2][0] <= (Low[0] + (-2 * TickSize)) )
    && (BarsSinceEntryExecution(2, "", 0) > 0))

    {

    ExitLong(Convert.ToInt32(Position.Quantity), @"LStop1", @"Long1");
    }


    ATTEMPTING TO TRIGGER when 20 Second bar dataseries CLOSE is Less than or Equal to the Renko Bar Low[0] (last completed bar of renko) less 2 ticks

    Thanks - hope the solution helps me and others

    #2
    Hello DTSSTS,

    That would require unlocking he strategy so that you can execute logic on the secondary series. The builder by default only executes logic on the primary but you can reference secondary series for conditions.

    In the unlocked strategy it will start with a return statement for BarsInProgress, that would need to be removed so you can form conditions using BarsInProgress:

    Code:
    if(BarsInProgress == 0)
    {
    
    }
    if(BarsInProgress == 1)
    {
        //exit logic on secondary series 
    }

    Comment


      #3
      Unlocked this is what I found

      if (BarsInProgress != 0)
      return;

      so blocked both lines (ie removed)

      then Adding you example code


      if(BarsInProgress == 0)
      {

      }
      if(BarsInProgress == 1)
      {
      //exit logic on secondary series
      }

      BUT I HAVE STATED in my post that I have 2 additional dataseries, and I actually am adding a 3rd additional series at this point

      SO DO I NEED A LINE OF CODE FOR EACH DATA SERIES "if(BarsInProgress == 1)"

      AND " //exit logic on secondary series " IS JUST A NOTE CORRECT?

      THUS I NEED

      if(BarsInProgress == 0)
      {

      }
      if(BarsInProgress == 1)
      {

      }

      if(BarsInProgress == 2)
      {

      }

      if(BarsInProgress == 3)
      {

      }


      AND DOES THIS STAY THE SAME


      if (CurrentBars[0] < 3
      || CurrentBars[1] < 5
      || CurrentBars[2] < 0)
      || CurrentBars[3] < 0)
      return;


      THANKS FOR THE HELP

      fwiw Unlocked WITH above changes my back test results are very erratic
      Last edited by DTSSTS; 07-13-2022, 04:21 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      132 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X