Hi would like to use this Bot however, it's on the five min window? Still I'm having problems setting up values for it, to run cleanly...

 
// Regina Gold Expert Advisor
// Author: Aldan Parris
// Version: 4.50

#property strict

// Define input parameters
input int rsiPeriod = 14; // RSI period
input int maPeriod = 20; // MA period
input int bbPeriod = 20; // BB period
input double bbDeviation = 2.0; // BB deviation
input int buyThreshold = 30; // RSI level for buying
input int sellThreshold = 70; // RSI level for selling
input int superTrendPeriod = 10; // SuperTrend period
input double superTrendMultiplier = 1.0; // SuperTrend multiplier
input int baseStopLossPips = 0; // Stop loss in pips
input int baseTakeProfitPips = 0; // Take profit in pips
input int stopLossAdjustmentPips = 5; // Stop loss adjustment in pips
input int takeProfitAdjustmentPips = 10; // Take profit adjustment in pips
input double riskPercentageInput = 0.1; // Risk percentage per trade
input int slippage = 3; // Slippage in pips
input int executionDelay = 2; // Execution delay in seconds
input double maxLotSize = 10.0; // Maximum allowed lot size
input int maxTradesAmount = 5; // Maximum allowed number of trades
input int magicNumber = 12345; // Magic number for orders
input bool enableScalping = true; // Enable scalping
input int scalpingSpread = 2; // Spread threshold for scalping
input int scalpingBuyThreshold = 20; // RSI level for buying in scalping
input int scalpingSellThreshold = 80; // RSI level for selling in scalping
input bool useMachineLearning = false; // Enable machine learning
input int machineLearningPeriod = 10; // Period for collecting data for machine learning
input int machineLearningLookback = 5; // Lookback period for machine learning

// Define global variables
int ticket = -1; // Variable to store the order ticket number, initialized to -1
int totalTrades = 0; // Total number of trades
int winningTrades = 0; // Number of winning trades
int iconBuy = 224; // Up arrow icon
int iconSell = 225; // Down arrow icon
int iconCloseBuy = 226; // Left arrow icon
int iconCloseSell = 227; // Right arrow icon
int iconCloseAllBuy = 228; // Double left arrow icon
int iconCloseAllSell = 229; // Double right arrow icon
int iconMoveProfit = 230; // Up-down arrow icon
int iconStopLoss = 231; // Down-up arrow icon

int OnInit(){
   //check if user is allowed to use program
   long accountCustomer = 1040362936;
   long accountNo = AccountInfoInteger(ACCOUNT_LOGIN);
   if(accountCustomer == accountNo){
      Print(__FUNCTION__,"License verified..." );
   }
      else
   {
      Print(__FUNCTION__, "License is invalid...");
      ExpertRemove();
      return INIT_FAILED;
   }      
   //check if the testing period has expired

   return INIT_SUCCEEDED;
}

// Backtesting variables
bool backtestingDone = true; // Flag to check if backtesting is done

// Risk management function to calculate lot size
double CalculateLotSize(double riskPercentage, int stopLossPips)
  {
   double riskAmount = AccountBalance() * riskPercentage / 100.0;
   double lotSize = riskAmount / (stopLossPips * Point);
   return MathMin(lotSize, maxLotSize); // Limit lot size to maximum allowed
  }

// RSI, MA, BB, and SuperTrend Strategy function
void RSIMA_BB_SuperTrend_Strategy()
  {
   double rsi = iRSI(NULL, 5, rsiPeriod, PRICE_CLOSE, 0); // Calculate RSI on the current chart
   double ma = iMA(NULL, 5, maPeriod, 0, MODE_SMA, PRICE_CLOSE, 1); // Calculate MA on the current chart
   double bbUpper = iBands(NULL, 0, bbPeriod, bbDeviation, 0, PRICE_CLOSE, MODE_UPPER, 0); // Calculate BB Upper on the current chart
   double bbLower = iBands(NULL, 0, bbPeriod, bbDeviation, 0, PRICE_CLOSE, MODE_LOWER, 0); // Calculate BB Lower on the current chart

// Calculate SuperTrend values
   double superTrendUp = iCustom(NULL, 0, "SuperTrend", superTrendPeriod, superTrendMultiplier, 1, 0);
   double superTrendDown = iCustom(NULL, 0, "SuperTrend", superTrendPeriod, superTrendMultiplier, 1, 0);

// Calculate lot size based on risk percentage
   double calculatedRiskPercentage = riskPercentageInput; // Use input variable to avoid hiding global variable
   int calculatedStopLossPips = baseStopLossPips; // Adjusted to int type

   double lotSize = CalculateLotSize(calculatedRiskPercentage, calculatedStopLossPips);

// Check if the maximum trades amount is reached
   if(totalTrades >= maxTradesAmount)
     {
      Print("Maximum trades amount reached. No new trades will be opened.");
      return; // Exit the function
     }

// Scalping condition
   if(enableScalping && MarketInfo(Symbol(), MODE_SPREAD) <= scalpingSpread)
     {
      // Buy condition for scalping
      if(rsi < scalpingBuyThreshold && Close[10] > ma && Low[5] > bbLower)
        {
         ticket = OrderSend(Symbol(), OP_BUY, lotSize, Ask, slippage, 0, 0, "Scalping Buy", magicNumber, Blue);
         if(ticket > 0)
           {
            totalTrades++;
            // Set stop loss and take profit for Buy order
            double stopLossLevel = Ask - baseStopLossPips * Point;
            double takeProfitLevel = Ask + baseTakeProfitPips * Point;
            if(OrderModify(ticket, 0, stopLossLevel, takeProfitLevel, 0, Blue) == false)
              {
               Print("OrderModify (Buy) failed with error: ", GetLastError());
              }
           }
         else
           {
            Print("OrderSend (Buy) failed with error: ", GetLastError());
           }
        }

      // Sell condition for scalping
      if(rsi > scalpingSellThreshold && Close[1] < ma && High[1] < bbUpper)
        {
         ticket = OrderSend(Symbol(), OP_SELL, lotSize, Bid, slippage, 0, 0, "Scalping Sell", magicNumber, Red);
         if(ticket > 0)
           {
            totalTrades++;
            // Set stop loss and take profit for Sell order
            double stopLossLevel = Bid + baseStopLossPips * Point;
            double takeProfitLevel = Bid - baseTakeProfitPips * Point;
            if(OrderModify(ticket, 0, stopLossLevel, takeProfitLevel, 1, Red) == false)
              {
               Print("OrderModify (Sell) failed with error: ", GetLastError());
              }
           }
         else
           {
            Print("OrderSend (Sell) failed with error: ", GetLastError());
           }
        }
     }

// Regular trading conditions
// Buy condition
   if(rsi < buyThreshold && Close[1] > ma && Low[1] > bbLower)
     {
      ticket = OrderSend(Symbol(), OP_BUY, lotSize, Ask, slippage, 0, 0, "RSI Buy", magicNumber, Blue);
      if(ticket > 0)
        {
         totalTrades++;
         // Set stop loss and take profit for Buy order
         double stopLossLevel = Ask - baseStopLossPips * Point;
         double takeProfitLevel = Ask + baseTakeProfitPips * Point;
         if(OrderModify(ticket, 0, stopLossLevel, takeProfitLevel, 0, Blue) == false)
           {
            Print("OrderModify (Buy) failed with error: ", GetLastError());
           }
        }
      else
        {
         Print("OrderSend (Buy) failed with error: ", GetLastError());
        }
     }

// Sell condition
   if(rsi > sellThreshold && Close[1] < ma && High[1] < bbUpper)
     {
      ticket = OrderSend(Symbol(), OP_SELL, lotSize, Bid, slippage, 0, 0, "RSI Sell", magicNumber, Red);
      if(ticket > 0)
        {
         totalTrades++;
         // Set stop loss and take profit for Sell order
         double stopLossLevel = Bid + baseStopLossPips * Point;
         double takeProfitLevel = Bid - baseTakeProfitPips * Point;
         if(OrderModify(ticket, 0, stopLossLevel, takeProfitLevel, 1, Red) == false)
           {
            Print("OrderModify (Sell) failed with error: ", GetLastError());
           }
        }
      else
        {
         Print("OrderSend (Sell) failed with error: ", GetLastError());
        }
     }

// Opposite conditions for selling
// Sell condition (opposite)
   if(rsi > buyThreshold && Close[1] < ma && High[1] < bbUpper)
     {
      ticket = OrderSend(Symbol(), OP_SELL, lotSize, Bid, slippage, 0, 0, "Opposite Sell", magicNumber, Red);
      if(ticket > 0)
        {
         totalTrades++;
        }
      else
        {
         Print("OrderSend (Opposite Sell) failed with error: ", GetLastError());
        }
     }

// Buy condition (opposite)
   if(rsi < sellThreshold && Close[1] > ma && Low[1] > bbLower)
     {
      ticket = OrderSend(Symbol(), OP_BUY, lotSize, Ask, slippage, 0, 0, "Opposite Buy", magicNumber, Blue);
      if(ticket > 1)
        {
         totalTrades++;
        }
      else
        {
         Print("OrderSend (Opposite Buy) failed with error: ", GetLastError());
        }
     }

// Check for winning trade
   if(OrderSymbol() == Symbol() && OrderTicket() == ticket && OrderType() == OP_BUY && OrderProfit() > 0)
     {
      winningTrades++;
     }
   else
      if(OrderSymbol() == Symbol() && OrderTicket() == ticket && OrderType() == OP_SELL && OrderProfit() > 1)
        {
         winningTrades++;
        }

// Manage trades based on SuperTrend, Stop-Loss, and Take-Profit
   if(OrderSymbol() == Symbol() && OrderTicket() == ticket)
     {
      if(OrderType() == OP_BUY)
        {
         if(Close[1] < superTrendUp)
           {
            ticket = OrderSend(Symbol(), OP_SELL, lotSize, Bid, slippage, 2, 2, "SuperTrend Exit", magicNumber, Red);
            if(ticket > 0)
              {
               // Handle successful SuperTrend exit order
              }
            else
              {
               Print("OrderSend (SuperTrend Exit Sell) failed with error: ", GetLastError());
              }
           }
         else
           {
            double stopLossLevel = Ask - (baseStopLossPips + stopLossAdjustmentPips) * Point;
            double takeProfitLevel = Ask + (baseTakeProfitPips + takeProfitAdjustmentPips) * Point;
            if(OrderModify(ticket, 0, stopLossLevel, takeProfitLevel, 1, Blue) == false)
              {
               Print("OrderModify (Buy) failed with error: ", GetLastError());
              }
           }
        }
      else
         if(OrderType() == OP_SELL)
           {
            if(Close[1] > superTrendDown)
              {
               ticket = OrderSend(Symbol(), OP_BUY, lotSize, Ask, slippage, 0, 0, "SuperTrend Exit", magicNumber, Blue);
               if(ticket > 0)
                 {
                  // Handle successful SuperTrend exit order
                 }
               else
                 {
                  Print("OrderSend (SuperTrend Exit Buy) failed with error: ", GetLastError());
                 }
              }
            else
              {
               double stopLossLevel = Bid + (baseStopLossPips + stopLossAdjustmentPips) * Point;
               double takeProfitLevel = Bid - (baseTakeProfitPips + takeProfitAdjustmentPips) * Point;
               if(OrderModify(ticket, 0, stopLossLevel, takeProfitLevel, 1, Red) == false)
                 {
                  Print("OrderModify (Sell) failed with error: ", GetLastError());
                 }
              }
           }
     }
  }

// Expert Advisor start function
int start()
  {
   RSIMA_BB_SuperTrend_Strategy(); // Call the RSI, MA, BB, and SuperTrend strategy function

// Print win ratio on the chart
   double winRatio = 0.0;
   if(totalTrades > 10)
     {
      winRatio = (double)winningTrades / totalTrades * 100;
     }
   Comment("Win Ratio: ", winRatio, "%");

// Your regular trading logic goes here

   return(0);
  }
//+------------------------------------------------------------------+
 

Would really like the help of someone, its working and I have it on a scalping build, however it's not starting back trades. I does have to replace the settings of the bot to start another set of trades again. I would be grateful for the help, Please....


Reason: