Questions from Beginners MQL5 MT5 MetaTrader 5 - page 971 1...964965966967968969970971972973974975976977978...1605 New comment xxz 2018.12.22 15:38 #9701 Sprut112: Tried and failed to translate from a fixed lot to a percentage lot. Maybe someone can tell me on the full code?As a percentage of what? [Deleted] 2018.12.22 15:39 #9702 xxz: As a percentage of what?From the balance sheet, standard xxz 2018.12.22 15:52 #9703 Sprut112: From the balance sheet, the standard//+------------------------------------------------------------------+ //| Calculate optimal lot size | //+------------------------------------------------------------------+ double TradeSizeOptimized(void) { double price=0.0; double margin=0.0; //--- select lot size if(!SymbolInfoDouble(_Symbol,SYMBOL_ASK,price)) return(0.0); if(!OrderCalcMargin(ORDER_TYPE_BUY,_Symbol,1.0,price,margin)) return(0.0); if(margin<=0.0) return(0.0); double lot=NormalizeDouble(AccountInfoDouble(ACCOUNT_MARGIN_FREE)*MaximumRisk/margin,2); it's from the raw data input double MaximumRisk = 0.02; // Maximum Risk in percentage from available funds... [Deleted] 2018.12.22 15:55 #9704 xxz: this into the raw data Does this need to be placed instead of something or all together? xxz 2018.12.22 16:03 #9705 Sprut112: Does this need to be placed instead of something or all together?double get_lot(int pair, double input_lots) This function should be redesigned, it is called when you calculate a lot... [Deleted] 2018.12.22 16:10 #9706 xxz: redo this function, it is called when you calculate a lot...The compiler doesn't accept it xxz 2018.12.22 16:13 #9707 Sprut112: The compiler won't acceptI'll try your code now... [Deleted] 2018.12.22 16:20 #9708 xxz: I'm going to try your code now...Almost got it, there's only one error left - margin [Deleted] 2018.12.22 16:48 #9709 xxz: I'm going to try your code now...I don't seem to be able to... xxz 2018.12.22 16:57 #9710 Sprut112: Somehow it didn't work out for me.here's how it works... MM is a fixed lot option or a percentage option... Files: Experiment.mq5 40 kb 1...964965966967968969970971972973974975976977978...1605 New comment
Tried and failed to translate from a fixed lot to a percentage lot. Maybe someone can tell me on the full code?
As a percentage of what?
As a percentage of what?
From the balance sheet, standard
From the balance sheet, the standard
it's from the raw data
from available funds...
this into the raw data
Does this need to be placed instead of something or all together?
Does this need to be placed instead of something or all together?
This function should be redesigned, it is called when you calculate a lot...
redo this function, it is called when you calculate a lot...
The compiler doesn't accept it
The compiler won't accept
I'll try your code now...
I'm going to try your code now...
Almost got it, there's only one error left - margin
I'm going to try your code now...
I don't seem to be able to...
Somehow it didn't work out for me.
here's how it works...
MM is a fixed lot option or a percentage option...