Modify My EA Please - Dynamic Volume Size

İş tamamlandı

Tamamlanma süresi: 2 gün
Müşteri tarafından geri bildirim
Cannot Complain Very happy. Went above and beyond for me. Will hire again if needed.
Geliştirici tarafından geri bildirim
Thank you for the order, my Friend. 5-star customer.

İş Gereklilikleri

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

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(240)
Projeler
301
28%
Arabuluculuk
33
24% / 61%
Süresi dolmuş
9
3%
Çalışıyor
2
Geliştirici 2
Derecelendirme
(101)
Projeler
122
30%
Arabuluculuk
6
33% / 33%
Süresi dolmuş
5
4%
Çalışıyor
3
Geliştirici 3
Derecelendirme
(57)
Projeler
82
24%
Arabuluculuk
24
13% / 58%
Süresi dolmuş
7
9%
Yüklendi
4
Geliştirici 4
Derecelendirme
(21)
Projeler
28
36%
Arabuluculuk
7
14% / 71%
Süresi dolmuş
2
7%
Serbest
Benzer siparişler
Project Overview I am looking for an experienced MQL5 developer to build a custom, prop-firm-compliant trend-following Expert Advisor (EA) for MetaTrader 5 . This EA will be used on prop firm accounts (e.g., FTMO-style rules), so strict risk control and rule compliance are mandatory . This is NOT a grid, martingale, scalping, or recovery EA. The goal is consistency, rule compliance, and capital preservation , not
I would like to buy ea that is proven to be good need to have stable profit and can be very unstable DD but not more than 40 %you can send eas in dm for sale. I am looking of an Expert Advisor (EA) that has undergone independent validation and demonstrates a capability to successfully navigate prop firm challenges, as well as efficiently manage funded accounts. It is imperative that you provide a comprehensive
I am looking of an Expert Advisor (EA) that has undergone independent validation and demonstrates a capability to successfully navigate prop firm challenges, as well as efficiently manage funded accounts. It is imperative that you provide a comprehensive explanation of the strategy utilized by your EA, along with a demo version that has a 30-day expiration. This will facilitate extensive back testing and forward
I am seeking a highly skilled developer to build a fully functional automated Expert Advisor for MetaTrader 5 (MQL5)- XAUUSD fast in and out EA scalper that opens multiple trades following trend, uses dynamic lot sizing, and has to be – 24/5 unlimited. require the development of a high-speed, continuous fully automated trading Expert Advisor (EA) for MetaTrader 5, optimized for live trading on ICmarkets. The EA must
Hellow,l hope you are well,l am writing to place an order for a professional trading robot.l am looking for a reliable,well optimized robot that can trade efficiently,manage risk properly and deliver consistent performance in the market,I am particularly interested in a trading robot that uses a proven and transparent strategy,has strong risk management features,works well on common trading platforms,is suitable for
I am looking for an experienced MQL5 developer to build a professional MT5 software (indicator or semi-automated EA) for metals and major forex pairs. 📌 PLATFORM & MARKETS Platform: MetaTrader 5 Instruments: XAUUSD (Gold vs USD) XAGUSD (Silver vs USD) EURUSD GBPUSD USDJPY Trading styles: Scalping Intraday / short-term swing 🎯 MAIN OBJECTIVE I do NOT want an aggressive fully automated robot. I want a
I am seeking an experienced freelance marketing and algorithmic trading specialist to develop a user-friendly automated trading bot for the Pocket Option platform. The system should feature a simple and secure interface that allows direct login using my existing credentials. The bot will be designed to operate exclusively on multiple OTC currency pairs (a minimum of 10, such as EUR/USD OTC, GBP/JPY OTC, and similar
The robot will take buy trades when the 2 ema cross over the 10 ema and price has closed above the 50 ema. The take profit and stop loss can be set as an optional level by the user. The robot will take sell trades when the 2 ema cross under the 10 ema and price has closed under the 50 ema. The take profit and stop loss can be set as an optional level by the user. The entry timeframe will be 15 minutes, but it could
GoldTrade EA 30 - 60 USD
Hi, I am looking for someone who has already developed a high-performance Gold EA that can outperform the one shown in my screenshot. If you have such an EA, please apply for this job. Please describe how the EA works (for example, whether it uses a grid system) and provide backtest results along with the set files. If the EA meets my expectations, you can make the necessary adjustments and I will use it as my own
I am looking for someone who has or who can modify the Margin Trader EA by MaryJane preferably the MT5 version by making it pyramid using a fixed lot size addition(preferably 1st trade lot size) instead of using all the margin available to define the lotsize

Proje bilgisi

Bütçe
30+ USD
Son teslim tarihi
from 1 to 7 gün