fxDreema

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

    Something missing and i don't know what

    Questions & Answers
    2
    9
    1473
    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.
    • isp00rt
      isp00rt last edited by

      I'm working in a new simple EA but it doesn't work as I wish. This is why I ask for some help ;). Here's the project:

      https://fxdreema.com/shared/GFDBuTBye

      And this is what it is suposed to do:

      1. A buy and a sell are launched at current market conditions (tome frame 1 minute).
        First problem here: I don't know why but any of them are opened at current market price, but a few pips abaove/below ask/bid.

      2. After two minutes (two bars) has passed from open price, the stop loss can me modified according to the condition included in the "check stop loss" block .

      3. Once condition is met (moving average value at that bar plus/minus 5 pips), the stop loss should be moved up to that price:
        Second problem: stp loss is not moved at all.

      Any help would be appreciated. 😏

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

        Second problem solved. I simply disconnected buy/sell blocks from the rest of the blocks. Now I understand how it works. Sadly, problem 1 is still active. 😠

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

          Buy - is opened at Ask price,,, and is this Buy is closed at Bid price
          Sell - is opened at Bid price,,, and this Sell is closed at Ask price

          and example, if Buy is opened higher than offered Ask price - this is question for your broker 😄

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

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

            Ok. This is what I got so far:

            https://fxdreema.com/shared/Zkk80AJ6e

            Now I have a second problem again. My now moving SL goes up and down! How can I hold it shrinking in one direction only (upwards in a buy and downwards in a sell)? 😞

            Sorry for this permanent updating of the thread but I'm learning on the go! 😆

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

              __Buy - is opened at Ask price,,, and is this Buy is closed at Bid price
              Sell - is opened at Bid price,,, and this Sell is closed at Ask price

              and example, if Buy is opened higher than offered Ask price - this is question for your broker :D[/quote:25e6vnds]

              You're right. My broker is cheating me! 😳 😢

              Now I need a bit of help in my new second problem. 😏

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

                one of solutions can be comparing if the new SL (for buy) will be higher than current one, you can done it with variables 😄 but dont forget distinguish between pips and price, you can easy make mistake, ex. if you compare pips with price 😄
                variables:
                lastBuySL
                lastSellSL
                newBuySL
                newSellSL

                Condition block for Buy: if newBuySL>lastBuySL --- set new SL (after this store new SL into lastBuySL)
                Condition block for Sell: if newSellSL<lastSellSL --- set new SL (after this store new SL into lastSellSL)
                😄

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

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

                  Great! It worked very well. 😛 Now an additional difficulty is added and I know I'm close, but not enough. This is my project now (only buy section included):

                  https://fxdreema.com/shared/okGed5M9b

                  This is what the EA has to do:

                  1. A buy is opened with a specific TP and SL.
                  2. Two candles after opening (1 minute time frame) the SL can be moved, not before.
                  3. The SL moves at a fixed distance (5 pips) below the 10 periods moving average.
                  4. The trade finishes once TP or SL are reached.

                  It works perfectly so far except for one single point. Sometimes the moving average is so close to the SL that when adding those 5 pips, the new SL is moved below the original position, and I don't know how it not to happen. I see that in my first "Modify Order" block there an option to chose "pips" instead of "proce level" at the "Mode" option. Could this be the solution?

                  Thank you very much in advance.

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

                    you can try add new condition for measuring distance this MA from SL price, lets say logic:
                    measuring_distance > my_value (if true - next block can pass)
                    where measuring_distance you can get as difference between MA price and SL price (dont forget, here can be negative result)
                    and my_value is compared value, maybe you can set it with conditions like pips or normal price fraction (0.0010 ...)
                    🙂

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

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

                      Done. Thank you for your suggestion 😉

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

                      Online Users

                      K
                      M
                      T
                      E
                      A
                      P
                      V
                      R
                      M
                      G

                      19
                      Online

                      146.6k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors