fxDreema

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

    partial close based on candle size of the past

    Questions & Answers
    3
    12
    2024
    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

      Hope you can also help me on the way with this one. I want to partially close an order when it has reached a certain profit level, this profit is based on a candle size from a past candle.

      For example:

      • I enter on a candle 1 high (buy order):
        -When we reach a profit level that is equal to the size of candle 1 than I want to close 50% of trade.

      I tried this, but it does not seem to work I used the blocks in the picture, where you see I stored the desired candle under Modify variables.

      0_1487954765964_upload-f8717c1d-66d5-489a-a4cb-3ace51847d17

      Hope this is clear.

      Thanks in advance.

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

        Candle 1 is fixed candle on which trade is opened, or it is changeable candle as market is moving?

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

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

          It is a fixed candle, so when order is opened candle 1 will be used. This same candle still needs to be used after other candles have formed.

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

            use on Trade section for storing candle size into variable while Trade is created (pending is triggered) ..
            0_1488015162918_upload-1c42b534-34bf-4393-a7ae-9accaa4fe55c
            and rest in onTick:
            0_1488015180832_upload-23797712-e947-4740-baf7-2fb319126b41

            note, that this is working for one trade, when you have opened more trades, you need complicated system of differentiate between trades 😄

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

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

              Thanks for your response. Just a last question regarding your note, saying this will only work on one trade. Do you mean that if I have multiple orders each of them will not have their candle 1 stored separately? I thought the stored variable for one trade is is only connected to that trade, so being unique. Or am I wrong?

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

                one variable is holding one value until is changed, when is changed, new value is in this variable 😄

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

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

                  Ok thanks, so if I understand it correctly the variable with that specific name will be overridden when a new order is placed as it uses the same variable name.

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

                    yes, that is how variables works 🙂

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

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

                      This is the best explanation for what variables are that I know - https://www.youtube.com/watch?v=aeoGGabJhAQ

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

                        Thanks will have a look at that.

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

                          Another question about this. I noticed a partial close will create new orders in mt4 so it will replace the existing variable (which is stored in memory). Is there a way to avoid this? I don't want that partial closes will use a new candle 1 to write to an existing variable. Hope it is clear.

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

                            maybe like this, but I have not tried if it is working 😄

                            0_1488221517190_upload-4b7610d5-2b7d-4b28-86dc-777843b828c9

                            note, block numbers order is important (4,7,10 --- from lowest)

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

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

                            Online Users

                            O
                            Z
                            M
                            G
                            W
                            N
                            G
                            H
                            S
                            E

                            21
                            Online

                            146.7k
                            Users

                            22.4k
                            Topics

                            122.6k
                            Posts

                            Powered by NodeBB Forums | Contributors