Modify My EA Please - Dynamic Volume Size

工作已完成

执行时间2 天
客户反馈
Cannot Complain Very happy. Went above and beyond for me. Will hire again if needed.
员工反馈
Thank you for the order, my Friend. 5-star customer.

指定

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;}

反馈

1
开发者 1
等级
(253)
项目
316
29%
仲裁
34
26% / 65%
逾期
10
3%
空闲
2
开发者 2
等级
(101)
项目
122
30%
仲裁
6
33% / 33%
逾期
5
4%
工作中
3
开发者 3
等级
(60)
项目
87
29%
仲裁
24
13% / 58%
逾期
7
8%
已载入
4
开发者 4
等级
(21)
项目
28
36%
仲裁
7
14% / 71%
逾期
2
7%
空闲
相似订单
Pro firm setup 30+ USD
Hi, I am starting a futures prop firm. Are you able to help me get data feed for this with no delays and can handle many traders on the platform. Additionally, are you able to handle charts for us
Mam kody EA Bot. Chciałbym je dokończyć, dopracować i ukończyć projekty. Chciałbym otrzymać pliki SET po ukończeniu EA. Jeśli jesteś zainteresowany, skontaktuj się ze mną. Szukam doświadczonego programisty do stworzenia dedykowanego doradcy eksperckiego (EA) do tradingu. Programista powinien posiadać solidną wiedzę z zakresu MT5, logiki strategii, wskaźników, zarządzania ryzykiem i backtestingu. Doświadczenie w
I am looking for an experienced developer to create a custom Expert Advisor (EA) for trading. The developer should have strong knowledge of MT4/MT5, strategy logic, indicators, risk management, and backtesting. Experience in building reliable and professional trading robots is preferred. Please contact me if you have done similar projects before. 9817724000
5.20buy-20.5sell 50 - 1000 USD
⸻ 🧠 Professional AI Prompt (Clear English Version) Act as a professional algorithmic trading engineer with deep expertise in developing automated trading systems for TradingView and MetaTrader. You have strong knowledge of market behavior, trend analysis, and risk management. Your task is to design a fully automated trading strategy based on the following requirements: ⸻ 🎯 Entry Conditions: • Open a BUY trade
I need a skilled MQL5 developer to build a fully functional Expert Advisor (EA) for MetaTrader 5 based on a simple but strict trading strategy. The EA will use EMA 50/200 trend detection combined with breakout and retest logic for entries. It must operate only during London and New York sessions and include solid risk management (fixed % risk, SL/TP, trade limits, and basic protection rules). APPLY ONLY IF YOU HAVE
VWAP BB Sniper EA Quantum VWAP Scalper SmartFlow FX Bot Institutional Edge EA 🧠 PRODUCT OVERVIEW VWAP + Bollinger Bands Auto Trading System A high-precision forex scalping bot designed to capture institutional price movements using: VWAP (fair value tracking) Bollinger Bands (volatility & entry timing) 👉 Built for fast, consistent intraday profits
Hello traders, I have Quantum queen v3.52, which is the latest version, available for $500 only. The price on the platform is around $1800, but I am offering it for a much lower price for serious buyers. Details: Product: Quantum queen Version: v3.52 Price: $500 Condition: Serious buyers only
EA for prop firms 30 - 500 USD
Hi, I am looking to purchase a MT5 EA that can show consistent profitability 5% each month with drawdown less than 9%. I am not ready to build a new one from scratch as i do not have the strategy in mind yet so i do not want to take the risk of building one but not sure if it works. Only apply if you have an existing proven and tested EA that can sell to me together with the source code. The Ea is for prop firm even
Early Killer EA 30+ USD
It must have automated stop loss. Something that can end poverty and kill the market early.It must take the trades for me whenever I start it it must work on tradeport ea
I WANT TO CONVERT MY INDICATOR TO ROBOT, BUT I DONT HAVE THE SOURCE CODE , THE PROGRAMMER WILL DEVELOP THE SOURCE CODE FOR THE JOB. THE STRAGY IS SIMPLE , THE ROBOT WILL EXECUTE A TRADE WHEN THE SIGNAL FROM THE INDICATOR APPEARS. BUY SIGNAL IS WHEN THE ARROW APPEAS ON THE LOWER ZONE ( SUPPORT ZONE) SELL SIGNAL WHEN THE ARROW APPEARS ON THE UPPER ZONE ( RESISTANCE ZONE).THE ROBOT WILL HAVE THE FOLLWING FEATURES (1)

项目信息

预算
30+ USD
截止日期
 1  7 天