Modify My EA Please - Dynamic Volume Size

Tâche terminée

Temps d'exécution 2 jours
Commentaires du client
Cannot Complain Very happy. Went above and beyond for me. Will hire again if needed.
Commentaires de l'employé
Thank you for the order, my Friend. 5-star customer.

Spécifications

I need a dynamic lot size for my expert advisor with 3 input options:

1. fixed lot size (0.01)

if my account balance is $100,000 & I want to risk 0.01 lots per trade

2. Volume based on money ($1000)  Example: 

if my account balance is $100,000 & I want to risk $1000 of my account per trade (0.01 volume)

3. volume based on account percent (1%) Example: 

if my account balance is $100,000 & I want to risk 1% of my account per trade (0.01 volume)


Most of the code has already been done, it just doesn't do what i want it to...

Heres The Code:


input group "General Settings"                                  // General Setting Input Grouping
enum LOT_MODE_ENUM{                                            // Options
    LOT_MODE_FIXED,                                                  // Fixed Lots
    LOT_MODE_MONEY,                                                    // Lots Based On Money
    LOT_MODE_PCT_ACCOUNT                                          // Lots Based On % Of Account
};

input LOT_MODE_ENUM LotMode = LOT_MODE_FIXED;  // Lot Mode Option
input double   FixedLots              = 0.01;                     // Lots
input double   Money                = 1000;                     // Money
input double   PercentOfAccount      = 5;                          // Percent
input double   AccountBalance       = 100000;              // your account balance

    -------------------------Functions-------------------------------
// Calculate Lots
bool CalculateLots(double slDistance, double &lots){

   lots = 0.0;
   if(LotMode==LOT_MODE_FIXED){
   lots = FixedLots;
   }
   else{
      double tickSize = SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE);
      double tickValue = SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_VALUE);
      double volumeStep = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP);
     
      double riskMoney = LotMode==LOT_MODE_MONEY ? Money : AccountInfoDouble(ACCOUNT_BALANCE) * PercentOfAccount * 0.01;
      double moneyVolumeStep = (slDistance / tickSize) * tickValue * volumeStep;
     
      lots = MathFloor(riskMoney/moneyVolumeStep) * volumeStep;
   }
   // Check Calculated lots
   if(!CheckLots(lots)){return false;}
   
   return true;
}

// Check Lots For Min, Max And Step
bool CheckLots(double &lots){

   double min = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN);
   double max = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MAX);
   double step = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP);
   
   if(lots<min){
      Print("Lot Size Will Be Set To The Minimum Allowable Volume");
      lots = min;
      return true;
   }
   if(lots>max){
      lots = max;
   Print("Lot Size Will Be Set To The Maximum Allowable Volume");
   return false;
   }
   lots = (int)MathFloor(lots/step) * step;
   
   return true;
}

// Calculate Lots - Paste in between "calc sl & tp" & "Open buy positions"
double lots;
if(!CalculateLots(lastTick.bid-sl,lots)){return;}

// Calculate Lots - Paste in between "calc sl & tp" & "Open sell positions"
double lots;
if(!CalculateLots(sl-lastTick.ask,lots)){return;}

Répondu

1
Développeur 1
Évaluation
(264)
Projets
331
29%
Arbitrage
36
28% / 64%
En retard
10
3%
Travail
2
Développeur 2
Évaluation
(101)
Projets
123
31%
Arbitrage
7
29% / 29%
En retard
5
4%
Travail
3
Développeur 3
Évaluation
(62)
Projets
90
29%
Arbitrage
24
13% / 58%
En retard
7
8%
Travail
4
Développeur 4
Évaluation
(21)
Projets
28
36%
Arbitrage
7
14% / 71%
En retard
2
7%
Gratuit
Commandes similaires
MT4/MT5 HFT EA us30 30 - 3000 USD
Hello everybody, I'm looking for an experienced MQL4/MQL5 developer to optimize a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5. The EA performs consistently and profitably on demo accounts, but when it is run on Raw and Standard live accounts under what appear to be the same trading conditions, it begins generating losses. I do not have the original source code (.mq4/.mq5); I only have the
I'm looking for an experienced NinjaTrader 8 (C#) developer to build a fully automated futures trading strategy. Please apply only if you have proven experience developing and testing NinjaTrader strategies. Project Overview Develop a fully automated NinjaTrader 8 strategy. Designed for Apex funded and evaluation accounts. Primary instruments: NQ/MNQ Futures (with flexibility to support other futures later). Trading
Hello I need to purchase the source code of an already built profitable mt5 EA with proven track recordIf you have something similar and you are open to selling the source code please apply to this post Please note I am not looking for a dev to build the product from scratch , but need something that is already built and have at least one year worth of track record
I need an Expert Advisor for MT5 on XAUUSD 1min timeframe using SMC concepts. STRATEGY RULES: SELL: 1. Identify previous day High/Low as liquidity 2. Entry only during London-NY session: 15:00-19:00 GMT+3 or broker clock. 3. If price sweeps previous day High and closes back below it 4. Check for bearish 1min FVG below sweep candle 5. Wait for BOS - lower low 6. Entry: Sell/buy at 50% of the FVG 7. SL: 10 pips above
Code An Loss Rate 90-100% MT5 EA , that can blow a 100 USD account a day ,with fixed TP of 3000 points and SL of 3000 For better Rate Calculations get an strategy that can lead to so
Shooter razor 30+ USD
Makes it takes trades by it self buy and sell, it must use the higher signals, also when I press stop it must not pick any trades I want it to take trades automatically when I press start also close by it self
8 cap prop firm passing 30 - 3000 USD
I am looking for an experienced MQL4/MQL5 HFT developer to build or optimize a High-Frequency Trading (HFT) Expert Advisor that can successfully pass proprietary trading firm challenges and perform consistently under live trading conditions with brokers such as 8cap or BlackBull Markets . The developer should have proven experience with HFT execution, ultra-low-latency trading, broker execution, slippage, spreads
I need a professional MT5 Expert Advisor (MQL5) for XAU/USD (Gold) only. Requirements: - Symbol: XAU/USD only - Timeframe: H1 trend, M5 entry - Smart Money Concept (SMC) - Liquidity Sweep - Break of Structure (BOS) - Order Block Retest - Confirmation Candle (Engulfing or Pin Bar) - ATR-based Stop Loss - Risk:Reward = 1:3 (adjustable) - Auto Lot (1% risk) - Break Even - Trailing Stop - Maximum 2 trades per day - One
I have a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5 designed primarily for US30 (Dow Jones Index) . The EA performs consistently and profitably on demo accounts, but when I run it on an IC Markets Raw or Standard live account, it starts generating losses under what appear to be the same trading conditions. At this time, I cannot provide the source code (.mq4/.mq5). I can only provide the
I need an Expert Advisor for MT5 on XAUUSD 1min timeframe using SMC concepts. STRATEGY RULES: SELL: 1. Identify previous day High/Low as liquidity 2. Entry only during London-NY session: 15:00-19:00 GMT+3 3. If price sweeps previous day High and closes back below it 4. Check for bearish 1min FVG below sweep candle 5. Wait for BOS - lower low 6. Entry: Sell at 50% of the FVG 7. SL: 10 pips above sweep wick 8. TP: 2R

Informations sur le projet

Budget
30+ USD
Délais
de 1 à 7 jour(s)