Modify and debug EA functions that scans and for slpoints that will produce lotsize that is neither greater or less than the max& min lotsize for Deriv Synthetic indices.

Specification

Below  i have placed a the failed  attempt  to make functions code in mql5 the system should 
double input  riskPercent=20.0;                                              

void OnTick()
  {
//---
ScanSLPoints();
   
  }
//+------------------------------------------------------------------+
double Calculate_lotsize(double Riskpercent,double slDistance)
  {
   double ticksize=SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE);
   double tickvalue=SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_VALUE);
   double lotstep =SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP);
  // Print(ticksize,"ticksize ", tickvalue," tickvalue ",lotstep,"lotstep");
   if(ticksize==0 || tickvalue==0 || lotstep==0)
     {
      Print(__FUNCTION__,"< Lotsize cannot be calculated....");
      return 0;
     }
     
   double riskMoney =AccountInfoDouble(ACCOUNT_EQUITY)*Riskpercent/100;
   double Moneylotstep=(slDistance/ticksize)*tickvalue*lotstep;
   if(Moneylotstep==0)
     {
      Print(__FUNCTION__,"< Moneylotstep cannot be calculated....");
      return 0;
     }
   double lots =MathFloor(riskMoney/Moneylotstep)*lotstep;
Comment("riskmoney ",riskMoney,"Moneytobelost",Moneylotstep);
   return lots;
  }


void ScanSLPoints() {
    double minLot = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_MIN);
    double maxLot = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_MAX);
    double balance = AccountInfoDouble(ACCOUNT_BALANCE);
    double askPrice = SymbolInfoDouble(Symbol(), SYMBOL_ASK);

    for (double slPoints = 1.0; slPoints <= askPrice; slPoints += Point()) {
        double lotSize = Calculate_lotsize(riskPercent, askPrice - slPoints);
        if (lotSize >= minLot && lotSize <= maxLot) {
            Print("SL Points: ", slPoints, " Lot Size: ", lotSize);
        }
    }
}
the code above should show and  display  
Print("SL Points: ", slPoints, " Lot Size: ", lotSize);

the slpoints  should produce an equivalent lotsize which should always be in the range of max_lot and minlot for a certain balance so with every change in balance it should recalculate the slpoints and i must be  able to select a desired lotsize so that means the data can be stored in an external file so the system or functions should be run whenever there is a signal  because  of the dynamic price structue of boom and i have experienced runtime errors  as shown in lotsize.png  

Files:

PNG
lotsize_.PNG
30.5 Kb

Responded

1
Developer 1
Rating
(108)
Projects
123
20%
Arbitration
5
0% / 60%
Overdue
2
2%
Busy
2
Developer 2
Rating
(184)
Projects
188
27%
Arbitration
0
Overdue
3
2%
Free
3
Developer 3
Rating
(51)
Projects
70
43%
Arbitration
21
14% / 67%
Overdue
8
11%
Free
4
Developer 4
Rating
(8)
Projects
10
0%
Arbitration
3
33% / 33%
Overdue
0
Busy
5
Developer 5
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
6
Developer 6
Rating
(66)
Projects
143
34%
Arbitration
10
10% / 60%
Overdue
26
18%
Working
Similar orders
I need a bot that would buy or sell, then open a hedge if the trade is losing Create a hedging Expert Advisor (EA) in MQL5 for MetaTrader 5, which persistently opens counteracting trades based on the outlined logic, with features that manage the initiation and oversight of these trades, adhering to the defined multipliers for position sizes. The EA will terminate all trades once it achieves a collective take profit
i want close on reserve signal, auto lots, time fiter , TP SL TS ETC. I GET PAID ON THE 12TH, SO I WOULD LIKE A DEMO UNTIL 12/05/24 TO TEST IM WILL TOO PAY 60 USD FOR THE LONG WAIT
I need a good robot for prop firms Please only dm me if you are serious go to ftmo.com and see the challenge rules I want it to make a steady 5-12% monthly Less than 10% overall DD less then 5% daily DD
I desire a custom indicator that tracks two different types of gaps that have not been filled. Once the gaps are filled, the indicator should only show the net gaps that have not yet been filled. The indicator should indicate the gaps clearly (e.g. by use of arrows or whatever the developer may recommend). 1) Market gap is the first type of gap. This gap occurs if price opens well above or below the previous
I need a copier for mt5 that will copy to match trader. I need to be able to add multiple accounts. please be experienced in building copiers. if you have a test available even better. open to suggestions
I'm looking for a Filipino coder for my EA. Current code is about 3k lines uses custom logic. Need someone full time to help me fix it. My current is having entry issues and logic issues and needs some quick attention
Hi, I have one indicator for MT4 and it is working fine as I need. Now I want to convert it into MT5 version. The basic idea is that I put a starting date in one box, symbol in second box, number of lots in 3 box, per point value in 4th box. Indicator generate a virtual equity from starting minute till current date and time and shows it in 5th box and before this, it shows the starting price also, which I set by date
hey, I would like to order EA as per specifications. Using two indicators - Bollinger Bands and MA. Opening subsequent positions in a given size (with a specific SL and TP) after a loss in accordance with the assumptions. Additionally, I need a descriptive dashboard on a chart
Modification of an ea 30 - 45 USD
1. Programming language: Python 2. Platforms: MT4 and MT5 3. Indicators: - MACD (24, 52, 9) - RSI (15, 85) - VWAP 4. Trading logic: - Buy signal: MACD crossover below neutral line, RSI oversold, bullish candle above VWAP - Sell signal: MACD crossover above neutral line, RSI overbought, bearish candle below VWAP - Open buy and close sell, or open sell and close buy simultaneously 5. Additional features
Greetings Programmers. I am looking for someone who can fix three issues on my EA. Please do not apply if you are currently working on another project. I need someone who is available and can start immediately. Everything already exist it needs to be better and when trades are open it must close the trades when opposite signal are provided. Buy above the Horizontal Line and Sell below the Horizontal Line

Project information

Budget
30 - 50 USD
For the developer
27 - 45 USD