fxDreema

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

    close trade when candle closes down

    Questions & Answers
    3
    7
    3736
    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
      fishbo last edited by

      Can someone please help me. I have created an ea for renko and so far I have the opening logic is fine and the logic for closing a trade in profit is good too but I cant figure out how to get a trade that is not in profit to close under my logic. I have it working using a traditional stop loss but I feel it would be much better if it close in this way. I have attached a picture to make things easy
      0_1495724693287_Screenshot (88).png

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

        in case it is renko, use something as "virtual price value" to close it ...

        this virtual price value you save into variable after new trade is opened and its value is:
        Buy opened .... vpvBuy=ClosePrice from previous candle - renkoSizeInPriceFraction for Buy, or
        Sell opened .... vpvSell=ClosePrice from previous candle + renkoSizeInPriceFraction for Sell

        after this use condition block which compare:
        if Buy exist ... CurrentPrice<=vpvBuy ... close Buy ... vpvBuy=0 (save to low value)
        if Sell exist ... CurrentPrice>=vpvSell ... close Sell ... vpvSell=10000000 (save to big value)

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

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

          thank you for the response. looks like I have a project for the weekend. another question.
          the EA I have already is working fine on Eur/Usd but wont place a trade on dax. any sugestions

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

            if it is offline chart, it can be some misunderstanding in timeframes ..

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

            1 Reply Last reply Reply Quote 0
            • F
              fishbo @miro1360 last edited by

              @miro1360
              I have tried to figure out what I am supposed to do with this information but to be honest I have no clue. would it be possible for you to give me an example please

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

                "Once per bar"?

                https://fxdreema.com/help/working-with/on-candle-close

                F 1 Reply Last reply Reply Quote 0
                • F
                  fishbo @fxDreema last edited by

                  @fxDreema
                  That's got it. thank you so much. it was so simple in the end! once per bar-close losable trades with the filter of more than Xpips. I'm so grateful!!!

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

                  Online Users

                  H
                  A
                  M
                  S
                  E
                  M
                  F
                  E
                  R
                  F
                  N
                  J
                  H

                  33
                  Online

                  146.9k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors