fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    How can a SL based on currency be set up?

    Questions & Answers
    5
    28
    5884
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • l'andorrà
      l'andorrà @trader.philipps last edited by

      @trader-philipps said in How can a SL based on currency be set up?:

      @l-andorrà You might also consider trading costs such as commissions. That can be significant for a scalper for instance. And also consider minimum stopplevel on symbol as that can easily mess up your risk management.
      All in all I don't think that that approach is a good one as it keeps out market condition from risk calculations at all.

      Oh, man. I'm still trying to understand what road did and you are pushing it far beyond 🙂 Give me a breath, man! 😄

      (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

      (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

      (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

      T 1 Reply Last reply Reply Quote 1
      • T
        trader.philipps @l'andorrà last edited by

        @l-andorrà what @roar tries to do is to calculate the pip value in the base currency. You might check this thread if there's an indicator doing the job for you. https://www.forexfactory.com/showthread.php?t=54800
        I haven't tried any of those, but maybe that's what you need.
        Once you know the pip value you can divide your risk money by your static lot size and then you know your SL in pips.

        I like to share my knowledge, but expect the others to contribute as well.

        1 Reply Last reply Reply Quote 1
        • l'andorrà
          l'andorrà last edited by

          I will take a look on it, trader. Thank you very much. 😉

          (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

          (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

          (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

          1 Reply Last reply Reply Quote 0
          • l'andorrà
            l'andorrà @roar last edited by

            @roar said in How can a SL based on currency be set up?:

            @l-andorrà When I think about it, actually it doesn't get that much more complicated.

            You just need to do the final correction with a pair EURxxx, where xxx is the base currency of your chart.
            Example: when trading GBPJPY, sl formula is now:
            SL (price fraction) = risked money / (lotsize*100000) * iClose(EURJPY,0,0)

            https://fxdreema.com/shared/mmBhaLp9
            Check this example project, it's mql5 though

            Ok. Now I finally took a look on it and I have a few more questions, please.

            1. Is the 'conversion_pair' variable of a string type? What is its default value?
            2. What if the account is in USD and not in EUR? Some symbols are 'USD'+conversion_pair and others conversion_pair+'USD'. Should I modify the formula text on a case by case basis?

            (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

            (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

            (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

            T roar 2 Replies Last reply Reply Quote 0
            • T
              trader.philipps @l'andorrà last edited by

              @l-andorrà Here is a simple implementation without taking into account trading costs such as commissions, spread, etc.

              0_1575001388915_pipvalue-simple.mq4

              I hope the calculation is right like that. Maybe @roar may check. Further I put calculation on the onInit tab. Somehow it diesn't realize changing the constants unless you change the currency pair, but this is just ment to be a prototype. The pip value calculation I took from here (https://www.mql5.com/de/code/12418). So all honours go to the author.

              I like to share my knowledge, but expect the others to contribute as well.

              l'andorrà 1 Reply Last reply Reply Quote 0
              • roar
                roar @l'andorrà last edited by roar

                @l-andorrà sorry, I should have left some more detailed explanation with my scribble.

                1. Is the 'conversion_pair' variable of a string type? What is its default value?

                Yes, it's a string. It has empty default value - the value will anyway get replaced here:
                0_1575024070744_a8266dba-8559-4a91-a472-050c1ca5d8e1-image.png

                1. What if the account is in USD and not in EUR? Some symbols are 'USD'+conversion_pair and others conversion_pair+'USD'. Should I modify the formula text on a case by case basis?

                The "lots" you buy or sell are always in the base currency. So the first part of the formula calculates the SL in terms of that base currency, whatever it is.
                0_1575024318477_d199af0d-80da-4b50-9349-9daac701ce80-image.png

                Now that we have solved the SL in the base currency, we have to set a multiplier to get the correct EUR value (or dollar, or whatever you like)
                0_1575024458980_9115a1b2-c8ff-4588-b216-ab8f083b4ce6-image.png

                This is done by getting the current exchange rate of the base currency of our trade and EUR (or dollar, or whatever you like).
                I find the exchange rate by building the symbol in the string:
                0_1575024585294_9e535e3e-60b1-4357-a76c-7a9533cc1097-image.png

                Note that I select the "Quote currency" instead of "Base currency", because we are sort of reversing the effect.
                If you need the SL in dollars instead of euros, just replace EUR with USD in the string. Just those 3 letters, nothing else. This should work in all cases, no matter if its USDxxx or xxxUSD, the EA will always know the base currency.

                BUT you need to have that EURxxx currency in your symbols list, otherwise you must take a detour:
                If EURJPY is missing from your mt4, use USDJPY * EURUSD to get the value.

                @trader-philipps I couldn't get proper results from your example, maybe I tested it wrong 😞

                Here's my version in mql4: https://fxdreema.com/shared/VO1OeuqKb
                And a backtest result on AUDJPY, sl and tp set to 50 euros (note the average profit/loss differs a bit from 50, because the EA doesn't take trading costs into account.
                0_1575025365626_e7583cf9-0236-4837-b035-9cf0a50aa370-image.png

                Need small help? Tag me in your post
                Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

                l'andorrà 1 Reply Last reply Reply Quote 0
                • l'andorrà
                  l'andorrà @trader.philipps last edited by

                  @trader-philipps Thank you very much.

                  (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                  (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                  (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                  1 Reply Last reply Reply Quote 0
                  • l'andorrà
                    l'andorrà @roar last edited by

                    @roar Thank you very much, roar.

                    (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                    (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                    (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                    1 Reply Last reply Reply Quote 0
                    • 1
                    • 2
                    • 2 / 2
                    • First post
                      Last post

                    Online Users

                    S
                    M
                    2
                    M
                    M
                    N
                    B
                    A
                    B

                    19
                    Online

                    146.6k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors