Discussion of article "Writing an Expert Advisor using the MQL5 Object-Oriented Programming approach" - page 3 1234 New comment Snaf 2014.04.18 07:56 #21 VictorD:Please help me to understand something I don't understand:At the very beginning in the EA function is called: doInit triggered (probably by default these variables are assigned NULL and 0). setPeriod and setSymbol should be before Init. VictorD 2014.04.18 19:07 #22 Snaf: doInit is triggered (probably by default these variables are set to NULL and 0). setPeriod and setSymbol should be before Init.I see, thanks spinnybobo 2015.05.18 08:20 #23 Amazing article! I did not read entire thing yet, but already I can say that it is much much more helpful than anything I have seen thus far. Thank you so very much :-) Spencer Machine learning in trading: Discussion of article "Order Exponential Moving Average of MOHAMMED SAFAR AL-OTAIBI 2017.10.04 13:56 #24 if(base_currency=="USD") { one_lot_price=contract_size/levrage; } else { double bprice= SymbolInfoDouble(symbol,SYMBOL_BID); one_lot_price=bprice*contract_size/levrage; } Marvelous thread. thank you very much.There is some math mistakes.assume the pair is cadchf?? also you assume constant leverage for all symbols. most brokers have different leverages for some pairs.\any way the correct rule for any pair for the margin of 1 lots is Margin in account currenct is: C*Lots*YYYDDDYYY is the base currency, DDD: Domination currency\things will go fine with you until you reach CADCHF for example\YYYDDD = CADUSD. --------------- not USDCAD is whown in the Marketwacth\\\so you have to add third condition else-if Wishes for MT5 How to view leverage Calculate No Of Lots MOHAMMED SAFAR AL-OTAIBI 2017.10.04 13:57 #25 C=ContractSize/PairLeverage Metin Kostekci 2018.02.11 21:38 #26 very nice article.Thank you multiplicator 2019.01.30 05:40 #27 translation error forgot to insert this block.//--- Other parameters int STP,TKP; // To be used for Stop Loss & Take Profit values // Create an object of our class MyExpert Cexpert; pixparker 2020.11.14 02:50 #28 Thanks. very helpful article. it helped me to introduce to EA developing very quickly. Rahul Dhangar 2020.12.29 22:51 #29 Thanks @Samuel Olowoyo for this amazing article. Although this article is written 10 yrs back but it still hold ground for budding EA coders. Are you still active on MQL5? I can only see 4 articles published by you (all published in 2010) Automated trading strategies Templates to create EAs Different colors on ADX James Bernard Karlowicz 2022.11.18 21:47 #30 Thank you , Thank you , Thank you. I had already written out the code for my EA without understanding the power of OOP, but rest assured it will be much cleaner after reading this. lol Very well done "OnCalculate not found in A visual studio on Very slow calculation time 1234 New comment
Please help me to understand something I don't understand:
At the very beginning in the EA function is called:
doInit is triggered (probably by default these variables are set to NULL and 0). setPeriod and setSymbol should be before Init.
I see, thanks
Amazing article! I did not read entire thing yet, but already I can say that it is much much more helpful than
anything I have seen thus far. Thank you so very much :-)
Spencer
if(base_currency=="USD")
{
one_lot_price=contract_size/levrage;
}
else
{
double bprice= SymbolInfoDouble(symbol,SYMBOL_BID);
one_lot_price=bprice*contract_size/levrage;
}
Marvelous thread. thank you very much.
There is some math mistakes.
assume the pair is cadchf??
also you assume constant leverage for all symbols. most brokers have different leverages for some pairs.
\any way the correct rule for any pair for the margin of 1 lots is Margin in account currenct is: C*Lots*YYYDDD
YYY is the base currency, DDD: Domination currency\
things will go fine with you until you reach CADCHF for example\
YYYDDD = CADUSD. --------------- not USDCAD is whown in the Marketwacth\\\
so you have to add third condition else-if
C=ContractSize/PairLeverage
forgot to insert this block.
Thanks @Samuel Olowoyo for this amazing article. Although this article is written 10 yrs back but it still hold ground for budding EA coders.
Are you still active on MQL5? I can only see 4 articles published by you (all published in 2010)