Find your available trading margin and convert that to maximum lot size in MQL4 and MQL5

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025

Комментарии • 29

  • @watcharapong9051
    @watcharapong9051 11 месяцев назад +1

    Thank you uncle. You save my life .

  • @danielcioca1
    @danielcioca1 9 месяцев назад

    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!

    • @OrchardForex
      @OrchardForex  9 месяцев назад

      SYMBOL_MARGIN_HEDGED * price / ACCOUNT_LEVERAGE

  • @brainblood1
    @brainblood1 5 месяцев назад

    Thank you for sharing this incredible information

  • @norbertholsken2116
    @norbertholsken2116 Год назад

    Great! Saved me a lot of time. :))) Thank you!

  • @franciscojunior6841
    @franciscojunior6841 3 года назад

    Wow... Awesome! thank you so much

  • @SupremeSkeptic
    @SupremeSkeptic 3 года назад

    Thank you for the amazing video.
    Is it possible to hire you for a project?

  • @TheEcherriman
    @TheEcherriman 2 года назад

    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 ...

    • @OrchardForex
      @OrchardForex  2 года назад

      This code is a script, not an expert. You're getting the error because you are trying to compile it as an expert.

    • @TheEcherriman
      @TheEcherriman 2 года назад

      @@OrchardForex thanks again. Probably not worth pursuing but I do wonder how I managed to execute it as an EA !?!

    • @OrchardForex
      @OrchardForex  2 года назад

      @@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.

    • @TheEcherriman
      @TheEcherriman 2 года назад

      @@OrchardForex Hi, once again thank you for taking the trouble to respond, it's very kind of you !

  • @Dan_s_Channel
    @Dan_s_Channel 3 года назад

    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!

    • @OrchardForex
      @OrchardForex  3 года назад +1

      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) { ... }

    • @Dan_s_Channel
      @Dan_s_Channel 3 года назад

      @@OrchardForex thanks for the fast reply 👍🏻

    • @louisbrayton5117
      @louisbrayton5117 3 года назад

      @@OrchardForex I'm having the same problem with my live account...

    • @OrchardForex
      @OrchardForex  3 года назад

      @@louisbrayton5117 Which broker? These are standard MT functions and they return values supplied by the broker.

    • @Bullet_AK
      @Bullet_AK Год назад

      @@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.

  • @thayalanparamasawam
    @thayalanparamasawam 3 года назад

    Hi sir...how to contact u...

  • @otisbloomfield5229
    @otisbloomfield5229 2 года назад

    Hi Arthur, where can i get this script?

    • @OrchardForex
      @OrchardForex  2 года назад

      Sorry but this script has not been released for download.

    • @otisbloomfield5229
      @otisbloomfield5229 2 года назад

      @@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
      @OrchardForex  2 года назад

      @@otisbloomfield5229 Scripts only run once and exit

    • @otisbloomfield5229
      @otisbloomfield5229 2 года назад

      @@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

  • @rolehiring
    @rolehiring 2 года назад

    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%