fxDreema

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

    Break even point (Each trade)

    Questions & Answers
    2
    7
    1829
    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.
    • D
      DGRL last edited by DGRL

      EDIT,

      I got it to work now but i have to disable the input box
      Can someone please help me to code it that i can input an variable that will be used to multiply the spread?
      If possible i want to manually enter the factor per chart and not hardcoded

      Thanks in advance

      Dear forum members

      I am using the Break even point (Each trade) block and want to fill it with variable's
      1 variable is "MarketInfo(0,MODE_SPREAD)" and the other 1 is a multiply of 5

      When i put this in an alert message all works fine but when i apply these variables into the Break even point block the EA does not load.
      Does any one has an idea of what i am doing wrong?

      Thanks in advance

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

        Can you manually compile or provide the error code when the EA does not load?

        It can be that you are putting a space or it's a type issue (variable type)

        1 Reply Last reply Reply Quote 0
        • D
          DGRL last edited by DGRL

          Hi @fxzen

          Thanks for your answer
          Its working atm but not exactly on how i like
          MarketInfo(0,MODE_SPREAD) is giving me back the spread wich is good
          I can multiply it also but i want to multiply it with an INPUT BOX
          I made 3 variables in my project

          1 is var1 = MarketInfo(0,MODE_SPREAD)
          2 is var 2 = Test (test is getting a value from the formula block)
          3 is var 3 that should be var1 * var2
          When loading the EA it only places the stoploss at the value of var1 and not var3
          What i like to do is getting the current spread and then multply this with a input number using the input box

          maybe the picture makes things clear
          As you can see in the variable i am getting the spread (and i can multiply it hardcoded)
          But what i like to archive is that i multiply this using an input block ( can be any as long as it works)
          So basicly i want the break even point offset to be multiplied X times the current spread
          Is this possible?

          Thanks a lot for helping out

          0_1556906983275_caee031e-043b-4257-977d-ac81687474e8-image.png

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

            @DGRL
            I think I understand what you are after, it is a typecasting issue. I'm fairly certain it has to do with trying to do the calculation in the variables section and the way the code is Dynamically generated.

            Here the order is placed, and the multiple(2 in variable) * spread(8) = 160. So the SL is adjusted by 150 once in 20 pips of profit.

            Shared project:

            https://fxdreema.com/shared/1eFNI4ZZb

            Result:

            0_1556913854312_ee7fdac3-6458-43db-9f09-7ad8cc8f3499-image.png

            0_1556914013515_8e220ea9-f76c-4638-9b04-e588a50f0f81-image.png

            1 Reply Last reply Reply Quote 0
            • D
              DGRL last edited by

              @fxzen

              Finally got it to work
              Now i have a single input box that will multiply the spread
              See pic below
              Working like a charm 🙂

              0_1556914370421_48b8c647-4f89-48da-95ef-582b1570f48a-image.png

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

                @DGRL

                Awesome 😄

                1 Reply Last reply Reply Quote 0
                • D
                  DGRL last edited by

                  Thanks a lot

                  Off topic question if you dont mind
                  I have a time filter that will close all my trades at friday after 9:30PM servertime
                  After that i dont want my EA to trad anymore until let say sunday evening or monday morning
                  I have the first part of closing after 9:30PM on friday
                  But how do i prevent my EA from opening a new trade after 9:30PM?
                  See pic for what i have up to now

                  0_1556915099706_a435635c-44c0-46d1-a1db-995936b46563-image.png

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

                  Online Users

                  E
                  F
                  M
                  F
                  J
                  F
                  M
                  N
                  H
                  K

                  20
                  Online

                  146.7k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors