fxDreema

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

    EA for closing all orders at a target price

    Questions & Answers
    2
    4
    854
    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.
    • I
      isiloon last edited by

      I am trying to create an EA to close my all open orders (buy and sell together or can be set one or other) and my pending orders WHEN the PRICE hits a certain target which i set like 1.09500 from above or belove doesn't matter.

      I tried CONDITION with left operand is set to market properties ask price but couldn't figure out what to do for right operand so can't make it work. Will someone give a hand please?

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

        On the right use Value -> Numeric if you want the number to be fixed. You can use it as a Constant, also in the same place (right-click over the input field) - for this you just need to define a constant. Or you can use some horizontal line.

        But what is the most important here, DO NOT use == in the condition when comparing two prices. Use everything else, but not ==. If you think for a while, you will understand why.

        1 Reply Last reply Reply Quote 0
        • I
          isiloon last edited by

          __On the right use Value -> Numeric if you want the number to be fixed. You can use it as a Constant, also in the same place (right-click over the input field) - for this you just need to define a constant. Or you can use some horizontal line.

          But what is the most important here, DO NOT use == in the condition when comparing two prices. Use everything else, but not ==. If you think for a while, you will understand why.[/quote:fuqoa730]

          Ok I can use > or < for the trigger but I can not figure out how to code it. How do I use horizontal line or price value for the kill all switch?

          1 Reply Last reply Reply Quote 0
          • I
            isiloon last edited by

            ____On the right use Value -> Numeric if you want the number to be fixed. You can use it as a Constant, also in the same place (right-click over the input field) - for this you just need to define a constant. Or you can use some horizontal line.

            But what is the most important here, DO NOT use == in the condition when comparing two prices. Use everything else, but not ==. If you think for a while, you will understand why.[/quote:3atvaiba]

            Ok I can use > or < for the trigger but I can not figure out how to code it. How do I use horizontal line or price value for the kill all switch?[/quote:3atvaiba]

            I think I have done it. You just need the place the ea according to the price. If the price is gonna hit the kill all target from above you wanna use the above ea, same for the opposite. I tested it few times I think it works. Here I post the ea in case someone needs it.

            ......
            Kill all from above.ex4
            Kill all from below.ex4

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

            Online Users

            E
            E
            E
            S
            H
            A
            M
            S

            20
            Online

            146.9k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors