Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change Stops multiple times in an order based on Levels in OnBarUpdate() in backtest

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

    Change Stops multiple times in an order based on Levels in OnBarUpdate() in backtest

    When I add my strategy to the chart.....I cannot seem ALL THE TIME to get the Strategy to change the stop multiple times to my personal indicator levels as they hit in a backtest. SOMETIMES they do change but many times they do not. The Entry orders are being entered and the levels are plotting....so that is not the problem and as I said sometimes it works in the backtest. Just the stops are not changing/raising (long)/lowering(short) all the time.

    I followed the example given in SamplePriceModification_NT8.zip.
    I reset my stops when flat.
    I tried adding a return.
    I tried adding else statements.
    I tried reversing the order of the stops from the below.

    Can someone advise on this code? Its a play on Pivot levels but my personal ones. But to make it easier to understand I am showing R1, R2, R3, etc (to make it familiar)

    THE CODE LOGIC

    //Initial Stops and Targets
    // Resets the stop loss to the original value when all positions are closed

    if (Position.MarketPosition == MarketPosition.Flat)
    {
    SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorS1[0], true);
    SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorS1[0], true);
    SetStopLoss("Short", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR1[0], true);
    SetStopLoss("ShortReverse", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR1[0], true);
    }

    Should I be using ChangeOrder() instead? OR OnOrderUpdate()? Instead of SetStopLoss multiple times? How do I change the below code to PRESERVE the Stop Steps as each triggers rather than Revert?

    // Entry Rules - Long and Short signals
    (Code omitted for Entries as this is not the problem - it works)

    //Exit Rules - Move stops
    //Long Stop Trailing
    if (Position.MarketPosition == MarketPosition.Long)
    {
    if (High[0] > BigT_Auto_Indicator_V21.PriorR3M[0])
    {
    SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR2[0], true);
    SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR2[0], true);
    }

    if (Close[0] > BigT_Auto_Equilibrium_V21.PriorR2[0])
    {
    SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR2M[0], true);
    SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Indictator_V21.PriorR2M[0], true);
    }

    if (Close[0] > BigT_Auto_Equilibrium_V21.PriorR2M[0])
    {
    SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR1[0], true);
    SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR1[0], true);
    }

    if (Close[0] > BigT_Auto_Equilibrium_V21.PriorR1[0])
    {
    SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR1M[0], true);
    SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR1M[0], true);
    }

    if (Close[0] > BigT_Auto_Equilibrium_V21.PriorR1M[0])
    {
    SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Indicator_V21.EntryLine[0] + FluffTickSize * TickSize, true);
    SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Indicator_V21.EntryLine[0] + FluffTickSize * TickSize, true);
    }

    if (BarsSinceEntryExecution() == 5 && Close[0] < Position.AveragePrice)
    {
    ExitLong(QuantitySize, "TimeStop","Long");
    ExitLong(QuantitySize, "TimeStop","LongReverse");
    }

    if (BarsSinceEntryExecution() == 3 && Close[0] < Position.AveragePrice)
    {
    ExitLong(QuantitySize, "TimeStop","Long");
    ExitLong(QuantitySize, "TimeStop","LongReverse");
    }
    }

    // Short Stop Trailing
    (Code omitted as this is same format but reversed for Shorts)
    Last edited by BigT4X; 07-13-2022, 04:31 PM.

    #2
    Maybe to simplify my questions......how do you do multiple Automatic raising of your stops to specific levels in a Strategy? All I am trying to do is to make a Dynamic 7 to 10 Stairstep Stop Strategy..............which is better than just regular Trailing Stops.

    For example: IF it gets to 10.....move to 9.....if it gets to 11.75.....move to 10, if it gets to 12.50 move to 11, etc. The steps are not equal.

    Clearly the above code is not the right way. It is not moving/updating the stops properly.
    Last edited by BigT4X; 07-13-2022, 01:46 PM.

    Comment


      #3
      Hi BigT4X, thanks for posting. Here are some debugging techniques you can use.

      Use Print() to print out data from the strategy to make sure the stop change code is actually being called. e.g.

      Code:
      if (High[0] > BigT_Auto_Indicator_V21.PriorR3M[0])
      {
         Print("Setting Stop Loss for Long and LongReverse");
         SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR2[0], true);
         SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR2[0], true);
      }
      Another thing you can do to see if the stop modification is being ignored is turn on TraceOrders and observe the output window when you run the script:


      Kind regards,
      -ChrisL

      Comment


        #4
        I am no expert for sure......so I did what you asked. The code is being called. The problem is it is reverting back - see below. I have reversed the order of stops and done a bunch of other things....but nothing seems to work to preserve the stop at the step.....

        I will show example below of July 11th open to July 12th.....hopefully after looking at the below then we can look above at the code to see the problem....and make a suggestion how to fix

        Initial Short Stop Code:
        if (Position.MarketPosition == MarketPosition.Flat)
        {
        SetStopLoss("Short", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR1[0], true);
        SetStopLoss("ShortReverse", CalculationMode.Price, BigT_Auto_Indicator_V21.PriorR1[0], true);
        }

        Second and First Short Stop Code (currently in this order):

        if (Close[0] < BigT_Auto_Equilibrium_V21.PriorS1[0])
        {
        Print("Below S1 Setting Stop Loss for Short and ShortReverse");
        SetStopLoss("Short", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
        SetStopLoss("ShortReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
        }

        if (Close[0] < BigT_Auto_Equilibrium_V21.PriorS1M[0])
        {
        Print("Below S1M Setting Stop Loss for Short and ShortReverse");
        SetStopLoss("Short", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorEquilPP[0] - FluffTickSize * TickSize, true);
        SetStopLoss("ShortReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorEquilPP[0] - FluffTickSize * TickSize, true);
        }

        ===============
        RESULTS:
        Correct = starting Stop is correctly added:
        2022-07-11 6:15:00 PM Strategy 'BigTAutoEquilibriumFT/253999663': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='Short' Mode=Price Value=12025.125 IsSimulatedStop=True IsMarketIfTouched=False
        2022-07-11 6:15:00 PM Strategy 'BigTAutoEquilibriumFT/253999663': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='ShortReverse' Mode=Price Value=12025.125 IsSimulatedStop=True IsMarketIfTouched=False

        Correct = Stop moved from Starting Stop to the First Stop:
        Below S1M Setting Stop Loss for Short and ShortReverse
        2022-07-11 8:30:00 PM Strategy 'BigTAutoEquilibriumFT/253999663': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='Short' Mode=Price Value=11963.75 IsSimulatedStop=True IsMarketIfTouched=False
        2022-07-11 8:30:00 PM Strategy 'BigTAutoEquilibriumFT/253999663': Amended stop order orderId='NT-01496-345' account='Sim101' name='Stop loss' orderState=Working instrument='NQ 09-22' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=12025.25 quantity=1 tif=Day oco='NT-00790-345' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2022-07-11 18:15:00' gtd='2099-12-01' statementDate='2022-07-13' stopPriceChanged=11963.75
        2022-07-11 8:30:00 PM Strategy 'BigTAutoEquilibriumFT/253999663': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='ShortReverse' Mode=Price Value=11963.75 IsSimulatedStop=True IsMarketIfTouched=False

        Correct = it attempts to now move the Stop to the Second one and at first it does:
        Below S1 Setting Stop Loss for Short and ShortReverse
        2022-07-12 3:30:00 AM Strategy 'BigTAutoEquilibriumFT/253999663': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='Short' Mode=Price Value=11876.75 IsSimulatedStop=True IsMarketIfTouched=False
        2022-07-12 3:30:00 AM Strategy 'BigTAutoEquilibriumFT/253999663': Amended stop order orderId='NT-01496-345' account='Sim101' name='Stop loss' orderState=Working instrument='NQ 09-22' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=11963.75 quantity=1 tif=Day oco='NT-00790-345' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2022-07-11 18:15:00' gtd='2099-12-01' statementDate='2022-07-13' stopPriceChanged=11876.75
        2022-07-12 3:30:00 AM Strategy 'BigTAutoEquilibriumFT/253999663': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='ShortReverse' Mode=Price Value=11876.75 IsSimulatedStop=True IsMarketIfTouched=False

        WRONG = it Reverted right away back to the First Stop from the new one:
        Below S1M Setting Stop Loss for Short and ShortReverse
        2022-07-12 3:30:00 AM Strategy 'BigTAutoEquilibriumFT/253999663': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='Short' Mode=Price Value=11963.75 IsSimulatedStop=True IsMarketIfTouched=False
        2022-07-12 3:30:00 AM Strategy 'BigTAutoEquilibriumFT/253999663': Amended stop order orderId='NT-01496-345' account='Sim101' name='Stop loss' orderState=Working instrument='NQ 09-22' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=11876.75 quantity=1 tif=Day oco='NT-00790-345' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2022-07-11 18:15:00' gtd='2099-12-01' statementDate='2022-07-13' stopPriceChanged=11963.75
        2022-07-12 3:30:00 AM Strategy 'BigTAutoEquilibriumFT/253999663': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='ShortReverse' Mode=Price Value=11963.75 IsSimulatedStop=True IsMarketIfTouched=False

        Also if I move the stop manually (Drag and Drop).....it moves it back on the next bar too.

        How do I change the code above to PRESERVE/LOCK in the Stop Steps as each triggers rather than Revert until I want it changed again? Would that be a bunch of Else statements? NEED Suggestions to modify code from the first post?
        Last edited by BigT4X; 07-13-2022, 05:51 PM.

        Comment


          #5
          Adding "else" to all the if statements above in that order does not lock in the Stop levels as steps. Same behaviour happens in Orange above where the stop changes and then immediately reverts back. Need some sort of extra logic that locks in and keeps the new stop. Looking for suggestions?

          The end goal is to have around 15 stops per side when it is all said and done. So I would like a simple way to lock in the Step Stop than to have 30 values to check. I also cannot change the logic for each stop to check 15 different things.
          Last edited by BigT4X; 07-13-2022, 11:06 PM.

          Comment


            #6
            You need to had some bool logic to your stops so that they are only executed as you wish them to be. Typically this would be done with bool variables.

            Look at your conditions and ask yourself if it is possible that one or more of the conditions can be true at the same time, if so then you need to had a bool variable so that once one level is breached, you are no longer using that level to set the stop.

            Of course once the trade is finished you would need to reset the bools back to their original state for the next trade.

            Comment


              #7
              Thanks Tasker-182

              UPDATE to post below: This does not work.....same results. Anyone can suggest how to alter?

              So something like this then.......

              //Initial Stops and Targets
              // Resets the stop losses to the original values when all positions are closed

              if (Position.MarketPosition == MarketPosition.Flat)
              {
              SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
              SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
              LongStop1 = false;
              LongStop2 = false;
              LongStop3 = false;


              //Exit Rules on Long, LongReverse, Short and ShortReverse - Step stops
              //Long Stop Trailing

              if (Position.MarketPosition == MarketPosition.Long)
              {
              if (High[0] > BigT_Auto_Equilibrium_V21.PriorR3M[0]) //The TOP of the Stop ladder so no need to check for bool here
              {
              Print("Above R3M Setting Stop Loss for Long and LongReverse");
              SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2[0], true);
              SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2[0], true);
              LongStop1 = true;
              }
              if (LongStop1 = false && Close[0] > BigT_Auto_Equilibrium_V21.PriorR2[0])
              {
              Print("Above R2 Setting Stop Loss for Long and LongReverse");
              SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2M[0], true);
              SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2M[0], true);
              LongStop2 = true;
              }
              if (LongStop2 = false && Close[0] > BigT_Auto_Equilibrium_V21.PriorR2M[0])
              {
              Print("Above R2M Setting Stop Loss for Long and LongReverse");
              SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR1[0], true);
              SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR1[0], true);
              LongStop3 = true;
              }
              Last edited by BigT4X; 07-14-2022, 09:05 AM.

              Comment


                #8
                Tasker-182 or NinjaTrader_ChrisL or anyone?

                Not an expert here so I am sorry if my questions are simple.....but not a nube either and I am trying various things.....and hopefully many will benefit from this discussion.

                Update: This ALSO does not work.....same results. Can anyone suggest how to alter?

                //Initial Stops and Targets
                // Resets the stop losses to the original values when all positions are closed

                if (Position.MarketPosition == MarketPosition.Flat)
                {
                SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
                SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
                LongStop1 = false;
                LongStop2 = false;
                LongStop3 = false;


                //Exit Rules on Long, LongReverse, Short and ShortReverse - Step stops
                //Long Stop Trailing

                if (Position.MarketPosition == MarketPosition.Long)
                {
                if (High[0] > BigT_Auto_Equilibrium_V21.PriorR3M[0]) //The TOP of the Stop ladder = LongStop1
                {
                Print("Above R3M Setting Stop Loss for Long and LongReverse");
                SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2[0], true);
                SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2[0], true);
                LongStop1 = true;
                LongStop2 = false;
                LongStop3 = false;

                }
                if (LongStop1 = false && Close[0] > BigT_Auto_Equilibrium_V21.PriorR2[0]) //LongStop2
                {
                Print("Above R2 Setting Stop Loss for Long and LongReverse");
                SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2M[0], true);
                SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2M[0], true);
                LongStop1 = false;
                LongStop2 = true;
                LongStop3 = false;

                }
                if (LongStop2 = false && Close[0] > BigT_Auto_Equilibrium_V21.PriorR2M[0]) //LongStop3
                {
                Print("Above R2M Setting Stop Loss for Long and LongReverse");
                SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR1[0], true);
                SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR1[0], true);
                LongStop1 = false;
                LongStop2 = false;
                LongStop3 = true;

                }

                Comment


                  #9
                  Hi BigT4X, thanks for the follow up. If your stops are being reset to their original location, it means SetStopLoss() is being called with its original parameters. From the code snippet posted most recently tt looks like your brackets are not correct. Where is the closing bracket for if (Position.MarketPosition == MarketPosition.Flat)? It looks like there is more code beyond the closing bracket there.

                  Code:
                  if (Position.MarketPosition == MarketPosition.Flat)
                  [B]{ [/B]
                  SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
                  SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
                  LongStop1 = false;
                  LongStop2 = false;
                  LongStop3 = false;
                  [B]} //there should be a closing bracket here. [/B]
                  [B]//Exit Rules on Long, LongReverse, Short and ShortReverse - Step stops
                  //Long Stop Trailing[/B]
                  if (Position.MarketPosition == MarketPosition.Long)

                  Comment


                    #10
                    I don't know if you are posting the complete code, if you are then it looks like you are encompassing everything within if (Position. MarketPosition == MarketPosition.flat). As a suggestion, for future posts, include the complete code of the section so this means showing the enclosing { } of the code.

                    Here is a general example (psuedo code) of a fixed level stop process:

                    if (Position.MarketPosition == MarketPosition.Flat)
                    {
                    first_Level = true;
                    second_Level = false;
                    third_Level = false;
                    etc.etc.
                    }

                    if (Position.MarketPosition == MarketPosition.Long)
                    {
                    if (first_Level == true and some specific stop criteria is met)
                    {
                    set the stop to first level
                    first_Level = false; // set to false so this is not executed again.
                    }
                    if (first_Level == false and second_Level == false and some condition to adjust stop is true)
                    {
                    adjust stop to second level
                    second_Level = true; // to prevent usinmg 2nd level again
                    }
                    if (second_Level == true and third_Level == false and some condition to adjust to 3rd level is true)
                    {
                    adjust stop to third level
                    third_Level = true; // use once only.
                    }
                    (if you have other levels they would continue in this fashion)
                    } // closing brace for market position check.


                    No one wants to debug your code so definitely use print statements in each section to show the states of the bools if it is not performing as needed.

                    Comment


                      #11
                      NinjaTrader_ChrisL The post is already so long so I tried to shorten to just the applicable parts.....there is a } bracket.

                      For that part of the code its this:

                      //Initial Stops and Targets
                      // Resets the stop losses to the original value when all positions are closed
                      if (Position.MarketPosition == MarketPosition.Flat)
                      {
                      SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
                      SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
                      LongStop1 = false;
                      LongStop2 = false;
                      LongStop3 = false;
                      LongStop4 = false;
                      LongStop5 = false;
                      LongStop6 = false;
                      LongStop7 = false;

                      SetProfitTarget("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR3[0], true);
                      SetProfitTarget("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR3[0], true);

                      SetStopLoss("Short", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR1M[0], true);
                      SetStopLoss("ShortReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR1M[0], true);
                      ShortStop1 = false;
                      ShortStop2 = false;
                      ShortStop3 = false;
                      ShortStop4 = false;
                      ShortStop5 = false;
                      ShortStop6 = false;
                      ShortStop7 = false;

                      SetProfitTarget("Short", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS3[0], true);
                      SetProfitTarget("ShortReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS3[0], true);
                      }

                      Comment


                        #12
                        Hi BigT4X, I would recommend making a copy of this script so you can reduce it down to find the issue. There is a lot of code in here and it's getting in the way of finding the issue. You can make a copy of the script by right clicking the code>Save As>give it a new name. This will make a copy that you can edit without changing the original script. Make the initial stop loss work, once that is confirmed to work, add in another stop and keep working towards the original goal script.

                        Comment


                          #13
                          Tasker-182 Thanks for this (Post # 10) and your help.

                          I implemented it just slightly different BUT basically the same and it works!! This was all I needed. I will post a part of my code as a reference for others who are trying to do multi-level fixed stops.

                          Comment


                            #14
                            FIXED CODE - Please note below is just the Long side Multi-level Fixed Stops code and not the Entry Rules for the trades or the Short side Stops code. THIS is just an example of how to add multiple Fixed levels - See Post # 10 above too.

                            Key code in
                            Blue. Replace BigT_Auto code with your own.

                            //Initial Stops
                            // Resets the stop losses to the original value when all positions are closed

                            if (Position.MarketPosition == MarketPosition.Flat)
                            {
                            SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
                            SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorS1M[0], true);
                            LongStop1 = false;
                            LongStop2 = false;
                            LongStop3 = false;
                            LongStop4 = false;
                            LongStop5 = false;

                            }

                            //Long Fixed Trailing Stops
                            if (Position.MarketPosition == MarketPosition.Long)
                            {
                            if (LongStop1 == false && Close[0] > BigT_Auto_Equilibrium_V21.PriorR1M[0])
                            {
                            SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorEquilPP[0] + FluffTickSize * TickSize, true);
                            SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorEquilPP[0] + FluffTickSize * TickSize, true);
                            LongStop1 = true;
                            }

                            if (LongStop1 == true && LongStop2 == false && Close[0] > BigT_Auto_Equilibrium_V21.PriorR1[0])
                            {
                            SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR1M[0], true);
                            SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR1M[0], true);
                            LongStop2 = true;
                            }

                            if (LongStop2 == true && LongStop3 == false && Close[0] > BigT_Auto_Equilibrium_V21.PriorR2M[0])
                            {
                            SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR1[0], true);
                            SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR1[0], true);
                            LongStop3 = true;
                            }

                            if (LongStop3 == true && LongStop4 == false && Close[0] > BigT_Auto_Equilibrium_V21.PriorR2[0])
                            {
                            SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2M[0], true);
                            SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2M[0], true);
                            LongStop4 = true;
                            }

                            if (LongStop4 == true && LongStop5 == false && High[0] > BigT_Auto_Equilibrium_V21.PriorR3M[0])
                            {
                            SetStopLoss("Long", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2[0], true);
                            SetStopLoss("LongReverse", CalculationMode.Price, BigT_Auto_Equilibrium_V21.PriorR2[0], true);
                            LongStop5 = true;
                            }
                            }

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by NullPointStrategies, Yesterday, 05:17 AM
                            0 responses
                            54 views
                            0 likes
                            Last Post NullPointStrategies  
                            Started by argusthome, 03-08-2026, 10:06 AM
                            0 responses
                            131 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
                            44 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