Forum

Calculate margin for CFD

Formula for CFD to get margin , do not understand how to get Percentage with function ? Margin: Lots * ContractSize * MarketPrice * Percentage/100 If I use MarketInfo(Symbol(), MODE_MARGINREQUIRED) Then if pair is type: Forex (0) MarketInfo(symbol, MODE_MARGINCALCMODE) its output sum in dollars, but

[Q] Minimal SL ?

Is there a mql5 function witch can tell me, what is the minimal Stop Loss for the trade ? I manually calculated that minimal SL for GBPUSD for my broker is 13 pips, if I try to set smaller SL, it gives me error: Invalid StopLoss value. (fixed spread 3 pips) Not all brokers have this limitation

[bug] ObjectDelete

When deleting in cycle objects int total_objects = ObjectsTotal(chartid); for(int o=0; o<total_objects; o++){ string name = ObjectName(chartid, o); if (is_numeric(StringSubstr(name, 0, 1))){ ObjectDelete(chartid, name); } } not

how to calculate swap ?

How to calculate swap if lot size is 0.01 for gbpusd for short/long positions ? I'm now in short position in gbpusd for 0.01 lot, in Trade tap in Swap section i see $0.09 but if I try to get it by this printf("swap: buy: %f , sell: %f", SymbolInfoDouble(Symbol(), SYMBOL_SWAP_LONG)

Trade Stocks on MT5

Any one know where I can trade Stocks with mt5 ? Link please or name. not CFD Thanks

handle onPositionClose

Is there a handle ? onPositionClose(){ // do something } Handle which will check, when broker closing the position by SL or TP, the trigger will launch onPositionClose function and give me the position info

mql5 exec binary

How to execute my binary file with mql5 ? something like exec("c:\my_file.exe"); or maybe somehow import a dll which will do this ? please advice the main reason why i need this, i want to create a full workspace screenshot and save it to folder, maybe there is a other method ? ChartScreenShot()

How to get ChartID's in Strategy Tester ?

When I use a several pairs and run it in strategy tester , the two window will be created, EURUSD D1 and USDJPY D1: MqlRates d1[]; ArraySetAsSeries(d1, true); CopyRates("EURUSD", PERIOD_D1, 0, count_bars+1 ,d1); MqlRates d2[]; ArraySetAsSeries(d2, true); CopyRates("USDJPY", PERIOD_D1, 0

MT5 trailing stop, who is controlling it ?

When I set Trailing Stop, who is controlling it ? My software mt5(my computer), or broker

strategy tester, leverage 1000 - 2000 - 3000

Is there a way in strategy tester mql5 to modify maximum leverage 500, to 1000 or 3000 ? thanks