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.

명시

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  

파일:

PNG
lotsize_.PNG
30.5 Kb

응답함

1
개발자 1
등급
(109)
프로젝트
125
20%
중재
5
0% / 60%
기한 초과
3
2%
바쁜
2
개발자 2
등급
(184)
프로젝트
188
27%
중재
0
기한 초과
3
2%
무료
3
개발자 3
등급
(51)
프로젝트
70
43%
중재
21
14% / 67%
기한 초과
8
11%
무료
4
개발자 4
등급
(8)
프로젝트
11
0%
중재
3
67% / 33%
기한 초과
0
바쁜
5
개발자 5
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
6
개발자 6
등급
(66)
프로젝트
143
34%
중재
10
10% / 60%
기한 초과
26
18%
작업중
비슷한 주문
"I'm looking for a talented developer to help implement my custom NT8 strategy. Your expertise is key to the project's success. Are you interested in teaming up for a productive partnership? Let's discuss the details together. Thank you!"
p.p1 {margin: 0.0px 0.0px 12.0px 0.0px; font: 16.0px Times; color: #353535; background-color: #ffffff} p.p2 {margin: 0.0px 0.0px 12.0px 0.0px; font: 16.0px Times; color: #353535; background-color: #ffffff; min-height: 19.0px} I want to be clear before we start, so you are going to build me an expert advisor that works on MT5, that will also require an authorisation to work (like a license key, like the expert advisor
"I'm on the lookout for a proficient developer to help actualize my tailored NT8 strategy. Your mastery in this field is pivotal for the project's success. Would you be open to partnering for a mutually beneficial collaboration? Let's explore the details together. Thank you for considering!"
Hello I have Order Flow Chart & Software Depends on Ninjatrader I want to EA a trading robot that works on different platforms via API Expert NinjaTrader Programmer for Cross-Platform Trading Robot I'm in need of a skilled NinjaTrader programmer to develop a cutting-edge trading robot that seamlessly operates across various platforms via API integration? I want a customized Expert Advisors (EAs) tailored to your
"I'm in search of a skilled developer to bring my customized NT8 strategy to life. Your expertise is crucial for the success of this project. Would you be interested in joining forces for a fruitful collaboration? Let's connect to delve into the specifics together. Much appreciated!"
I HAVE A FUNCTIONAL MT5 EA (MQL5) THAT IS BASED ON CANDLE OPEN BUT I WOULD LIKE TO AUTOMATE IT WITH OTHER PROFITABLE STRATEGIES REQUIREMENT SPECIFICATION 1. I want an experienced developer to integrate a strategy to analyse the market and open buy only trade or sell only trade according to the direction of the analysis. 2. The modification and strategy should combine many confirmations that ensure high win rates of
I would like you to create an MT5 indicator and apply bollinger bands on a spread buffer. In MT4 we have iBandsOnArray but in MT5 there is nothing like that. Please find a way to create the Bollinger bands and apply them on a buffer. Just keep it simple. My only requirements are: 1. Close price buffer of EURUSD 2. Close price buffer of GBPUSD 3. Spread buffer which is buffer1 minus buffer2 (EURUSD close price -
I am in search of a skilled MQL5 developer with a proven ability to optimize trading robots across various assets, including synthetic indices like V75, Boom and Crash, gold, US30, US100, and more. I'm looking for an experienced developer to enhance my multi-asset trading EA, which was originally developed exclusively for V75 and is based on the smart money concept. The developer must be free in taking up the job
About the file i need I have ea ex4 file but it use to set buystop or sellstop oders etc now what I want is to fit the propfirm am using because the propfirm am using have a lot size consistency rules so what I need is even if the ea set multiple buystop the file will only allow the ea to pick 2 positions and automatically delete the nearest limit Oder it can only allow the ea buystop or new position once the two
Objective: To Create an EA based on an EMA cross Strategy that utilizes martingale account management strategy with multiple profiles to better manage risk and scale safely Strategy Concept: This strategy was created around Volatility Index 75 on the 5 minute chart. It was Observed that this Index tends to frequently form very strong trends with short periods of consolidation. On applying a 10 period

프로젝트 정보

예산
30 - 50 USD
개발자에게
27 - 45 USD