How can I create a switch that can make me change from fixed size lot to position sizing based on account balance or %risk. Please I need some help .
- Help open parenthesis expected
- Risk and Money management - important questions
- Trading on Account balance
Money Management
The forum
- MM (money management) calculation, indicators, discussion, tools: calculate your lot size and so on. Original thread with several versions.
- MoneyManagement EA is on this thread: it shows you market information and money management on the chart.
- Forex Money Management, Part 1 - good small thread
- Useful money management expert - the thread with the EA
- Stop Your Mind From Causing You to Take Profits Too Soon - the post with the educational video
- Money Management: How to Determine an Initial Stop Level - the post with the educational video
- Why Most Traders Lose Money and The Solution - the post with the educational video
The articles
- Statistical Verification of the Labouchere Money Management System
- Functions for Money Management in an Expert Advisor
- Fallacies, Part 1: Money Management is Secondary and Not Very Important
- MQL5 Wizard: How to Create a Risk and Money Management Module
- Money Management Revisited
- Cross-Platform Expert Advisor: Money Management
- Limitless Opportunities with MetaTrader 5 and MQL5
CodeBase
- Money Management Script - script for MetaTrader 4
- Example of SAR Automated - with Advanced Money Management - expert for MetaTrader 4
- Money Manager Graphic Tool - indicator for MetaTrader 4
- Order Manage EA - expert for MetaTrader 4
- Master Tools - indicator for MetaTrader 4
Anzoumana Dabila: How can I create a switch that can make me change from fixed size lot to position sizing based on account balance or %risk. Please I need some help .
enum MMMode{ Fixed, Percentage }; input MMMode RiskMode = Fixed; input double FixedRisk = 100; input double PercentaceRisk = 100; : double moneyRisk = RiskkMode == Fixed ? FixedRisk : PercentageRisk/100 * AccountBalance(); double lots = ComputeLots(moneyRisk, SL);
Is that so hard?
- In code:
Risk depends on your initial stop loss, lot size, and the value of the pair.
- You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
- Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
-
Do NOT use TickValue by itself - DeltaPerLot
and verify that MODE_TICKVALUE is returning a value in your deposit
currency, as promised by the documentation, or whether it is returning a value
in the instrument's base currency (EUR, in this case).
MODE_TICKVALUE is not reliable on non-fx instruments with many brokers. - You must normalize lots properly and check against min and max.
- You must also check FreeMargin to avoid stop out
- Use a EA GUI such as the one for MT4: Indicators: 'Money Manager Graphic Tool' indicator by 'takycard' Forum - Page 5
Anzoumana Dabila: I’m not good at coding I use EAbuilder
EA builder, fxDreema, EATree, FxPro Quant, MQL5 Wizard, etc.
are all the same. You will get something quick, but then you will spend a
much longer time trying to get it right, than if you learned to
the language up front, and then just wrote it.
-
Since you haven't learned MQL4/5, therefor there is no common language
for us to communicate.
If we tell you what you need, you can't code it.
If we give you the code, you don't know how to integrate it into yours.
We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own. -
EA builder makes bad code counting up while closing multiple orders.
EA builder makes bad code Bars is unreliable (max bars on chart) volume is unreliable (miss ticks) Always use time. New candle - MQL4 forum
EA builder makes bad code, not adjusting for 4/5 digit brokers, TP/SL and slippage.
EA builder makes bad code, not adjusting for ECN brokers. (pre-Build 500)
EA builder makes bad code, not checking return codes.
EATree uses objects on chart to save values - not persistent storage (files or GV+Flush.) No recovery (crash/power failure.)
Anzoumana Dabila:
I got the code , I’m trying to create a true or false , where i can switch from fixed lot size to %risk . Vice versa . I’m not good at coding I use EAbuilder and there is no such function in it. Thank you!
I got the code , I’m trying to create a true or false , where i can switch from fixed lot size to %risk . Vice versa . I’m not good at coding I use EAbuilder and there is no such function in it. Thank you!
Your options are learn to code, hire someone, or contact the developer of the EA Builder you used.
Excellent & Free Option #1: Documentation (Learn to code)
Excellent & affordable Option #2: Freelance (Hire someone)
Don't know. Don't care. Not our problem. Option #3: Contact the developer of the EA Builder you used.
MQL5 Reference - How to use algorithmic/automated trading language for MetaTrader 5
- www.mql5.com
MetaQuotes Language 5 (MQL5) is a high-level language designed for developing technical indicators, trading robots and utility applications, which automate financial trading. MQL5 has been developed by MetaQuotes Software Corp. for their trading platform. The language syntax is very close to C++ enabling programmers to develop applications in...
Anzoumana Dabila:
I got the code , I’m trying to create a true or false , where i can switch from fixed lot size to %risk . Vice versa . I’m not good at coding I use EAbuilder and there is no such function in it. Thank you!
Hello, did you solve it? Could you tell me how you did it? I also use EAbuilder. Thank you!!
I got the code , I’m trying to create a true or false , where i can switch from fixed lot size to %risk . Vice versa . I’m not good at coding I use EAbuilder and there is no such function in it. Thank you!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register