fxDreema

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

    Question about 'Adjust'

    Questions & Answers
    3
    8
    4175
    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.
    • F
      Flip last edited by

      I have been spending hours trying to figure the following out, but I am still not getting it to work.

      1. I am using a condition block where the Stop-loss is below Candle low 1, -8pips (see picture 1), this works correctly.

      2. Now I want to replace -8pips by the Constant value (marked in picture 2), but it also needs to be multiplied by " -1" as it needs to check previous candle low -8pips (the constant value is 8, so it should become -8).

      How can I achieve this best?

      0_1484651974873_upload-20720a8f-d082-47b7-9563-3acd739912d1

      1 Reply Last reply Reply Quote 0
      • M
        miro1360 last edited by

        I dont see whole name for your marked constant, lets say name is Pips_plus_for_trail_Ca
        you have at least 3 possibilities how to do it

        type into adjust field:
        -Pips_plus_for_trail_Ca
        and your constant must be typed as 0.0008 (8 pips price fraction for EURUSD, or 0.08 for GBPJPY)

        or you can make it from mql functions (SymbolInfoDouble(....)) but that is not so elegant 😄

        ...
        admin was thinking about this solution, but I have not tried it yet if it is done:
        https://fxdreema.com/forum/topic/4286/10pips/6
        so in adjust try this:
        -Pips_plus_for_trail_Ca pips
        or
        -(Pips_plus_for_trail_Ca) pips

        or maybe this? 😄 but this is probably not working yet (I have not tried) :
        -Pips_plus_for_trail_Ca@pips

        if none of them is working for you, try this not recommended solution with function from fxdreema (admin dont recomended this because it must not working 4-ever, after fxdreema update when is here name change of this function it stop working (only project compiling, not previously created EA) and you need rename it if you made some changes in project 😄 ) ...
        in adjust type:
        -(toDigits(Pips_plus_for_trail_Ca,SYMBOL))
        or
        -(toDigits(Pips_plus_for_trail_Ca,symbol))
        or
        -(toDigits(Pips_plus_for_trail_Ca,Symbol()))
        or
        -(toDigits(Pips_plus_for_trail_Ca))

        ...

        Between trading and gambling is a very small gap, be careful.

        1 Reply Last reply Reply Quote 0
        • F
          Flip last edited by

          Unfortunately only the not recommended option worked. I ended up using: -toDigits(Pips_plus_for_trail_CandleLow)

          I will have to keep this in mind for the future, if it is not supported anymore. Thank you!

          1 Reply Last reply Reply Quote 0
          • fxDreema
            fxDreema last edited by

            But I don't recommend using any custom function that I have created. toDigits() is just one of them and I can change it in future without asking anyone.

            ConstantName pips should work, this is the official way. If it doesn't work, then I need to know why. But in my little test that I did now it works...

            1 Reply Last reply Reply Quote 0
            • F
              Flip last edited by

              I wish I could tell you why it doesn't work with ConstantName pips. I also tried -(ConstantName) pips.

              I use two conditions after eachother. Picture one shows it using toDigits, picture 2 shows it with ConstantName pips.

              toDigits works correclty. With ConstantName pips, nothing happens. I didn't get any error though.

              I hope this helps.

              0_1484832208663_Schermafbeelding 2017-01-19 om 14.09.27.png 0_1484832230174_Schermafbeelding 2017-01-19 om 14.21.13.png

              1 Reply Last reply Reply Quote 0
              • fxDreema
                fxDreema last edited by fxDreema

                Oh no! Completely my fault. I was convinced that I did everything right, but I used the wrong MQL function for this. Indtead of toDigits() I was using toPips()... probably because it sound more like pips. Anyway, it should work now, at least I hope.

                1 Reply Last reply Reply Quote 0
                • F
                  Flip last edited by

                  Seems to work now, thanks!

                  1 Reply Last reply Reply Quote 0
                  • F
                    Flip last edited by

                    I just noticed that the issue described above in this topic still applies when using the adjust field with Variables instead of Constants. toDigits works VariableName pips doesn't. Any chance you can have a look at this?

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

                    Online Users

                    S
                    O
                    K
                    M
                    M

                    13
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors