Hello ! Thank you for your content, and welcome back..:) ...I have one queston thow ... OrderCalcMargin() from MT5 cannot be used in indicators. Any way around this? How to calculate margin per lot whitout using this function ? Thank you!
Hi, thanks for this. I encountered a problem with MT4 but converted to MT5 and it worked ! However, I amended the code to take into account the amount of margin I wanted to use and it stopped working. I reverted the code and it's still not working. MT4 gives the error, "'MarginCheck' is not an expert and cannot be exxecuted", MT5 says, "wrong type, loading of MarginCheck failed". I would be grateful for any pointers please ...
@@TheEcherriman The functions here can be easily moved to an EA. I just used a script to demonstrate because it's easier than coming up with a complete EA. I think you can still compile this in the EA folder and even run on a chart but it will run only once and then exit. Your other changes may have been incompatible with a script.
Thanks Arthur, in my demo account I got a call level of 125.0 percent and a stopout level of 100.0 percent. In mode MARGIN_LOTS_CALL I got negative values for available margin and lots also. How can I fix it? Thanks!
Those values are coming directly from the MT4 properties and probably mean that your broker just doesn't bother to set the values on a demo because they will never be used. If you want to test then I suggest capturing the values from your live account and then just force them on a demo account with something like if (AccountInfoInteger(ACCOUNT_TRADE_MODE)==ACCOUNT_TRADE_MODE_DEMO) { ... }
@@OrchardForex Hi Arthur. I am exactly on the same situation and I just figured out that my broker (cityindex) does set these values in and they are: marginCall to 125 and marginStopOut to 100. However, it does make sense that in your calculation, I am getting MARGIN_LOTS_CALL in negative and MARGIN_LOTS_STOPOUT as 0. Please have a look and can you please recommend a solution in this case? Thanks heaps.
@@OrchardForex ok thanks, would you happen to know why when I run your margin script then in MT4 it gets automatically removed uninit reason 0, it compiles with no errors, so it doesn't seem to an issue with the code
@@OrchardForex yes for sure, but what i meant to say is that when i drag it on my chart, nothing happens?? but in my log it says it loaded it then removed it..like its invisible
how to create fixed lot size for particular balance increase and decrease completly auto trade but stop loss fixed stop loss pip . (((( example my balance 26 dollar lot size 0.08 target profit ((10 pips)) stop loss risk 30% (( incase i won trader my next trade 0.10 target profit 10 pips stop loss risk 30% )) incase i lose the trade my balance 20 dollar my lot size 0.06 target profit 10 pips stop loss risk 30%
Thank you uncle. You save my life .
Hello ! Thank you for your content, and welcome back..:) ...I have one queston thow ... OrderCalcMargin() from MT5 cannot be used in indicators. Any way around this? How to calculate margin per lot whitout using this function ? Thank you!
SYMBOL_MARGIN_HEDGED * price / ACCOUNT_LEVERAGE
Thank you for sharing this incredible information
Glad it was helpful!
Great! Saved me a lot of time. :))) Thank you!
Glad it helped!
Wow... Awesome! thank you so much
Thank you for the amazing video.
Is it possible to hire you for a project?
Hi, thanks for this. I encountered a problem with MT4 but converted to MT5 and it worked ! However, I amended the code to take into account the amount of margin I wanted to use and it stopped working. I reverted the code and it's still not working. MT4 gives the error, "'MarginCheck' is not an expert and cannot be exxecuted", MT5 says, "wrong type, loading of MarginCheck failed". I would be grateful for any pointers please ...
This code is a script, not an expert. You're getting the error because you are trying to compile it as an expert.
@@OrchardForex thanks again. Probably not worth pursuing but I do wonder how I managed to execute it as an EA !?!
@@TheEcherriman The functions here can be easily moved to an EA. I just used a script to demonstrate because it's easier than coming up with a complete EA. I think you can still compile this in the EA folder and even run on a chart but it will run only once and then exit. Your other changes may have been incompatible with a script.
@@OrchardForex Hi, once again thank you for taking the trouble to respond, it's very kind of you !
Thanks Arthur, in my demo account I got a call level of 125.0 percent and a stopout level of 100.0 percent. In mode MARGIN_LOTS_CALL I got negative values for available margin and lots also. How can I fix it? Thanks!
Those values are coming directly from the MT4 properties and probably mean that your broker just doesn't bother to set the values on a demo because they will never be used. If you want to test then I suggest capturing the values from your live account and then just force them on a demo account with something like
if (AccountInfoInteger(ACCOUNT_TRADE_MODE)==ACCOUNT_TRADE_MODE_DEMO) { ... }
@@OrchardForex thanks for the fast reply 👍🏻
@@OrchardForex I'm having the same problem with my live account...
@@louisbrayton5117 Which broker? These are standard MT functions and they return values supplied by the broker.
@@OrchardForex Hi Arthur. I am exactly on the same situation and I just figured out that my broker (cityindex) does set these values in and they are: marginCall to 125 and marginStopOut to 100. However, it does make sense that in your calculation, I am getting MARGIN_LOTS_CALL in negative and MARGIN_LOTS_STOPOUT as 0. Please have a look and can you please recommend a solution in this case? Thanks heaps.
Hi sir...how to contact u...
Hi Arthur, where can i get this script?
Sorry but this script has not been released for download.
@@OrchardForex ok thanks, would you happen to know why when I run your margin script then in MT4 it gets automatically removed uninit reason 0, it compiles with no errors, so it doesn't seem to an issue with the code
@@otisbloomfield5229 Scripts only run once and exit
@@OrchardForex yes for sure, but what i meant to say is that when i drag it on my chart, nothing happens?? but in my log it says it loaded it then removed it..like its invisible
how to create fixed lot size for particular balance increase and decrease completly auto trade but stop loss fixed stop loss pip . (((( example my balance 26 dollar lot size 0.08 target profit ((10 pips)) stop loss risk 30% (( incase i won trader my next trade 0.10 target profit 10 pips stop loss risk 30% )) incase i lose the trade my balance 20 dollar my lot size 0.06 target profit 10 pips stop loss risk 30%