fxDreema

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

    Simple market buy/sell on MQL5 code

    Questions & Answers
    2
    4
    1180
    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.
    • N
      nilsen last edited by

      Hi,

      I would like to do a simple market buy/sell on a "custom MQL code" (MQL5) node but I can't figure how.

      I've tried to put some code I've found but it gives error. Like: trade.Buy(0.01,NULL);

      Can anybody tell me how to do it?

      roar 1 Reply Last reply Reply Quote 0
      • roar
        roar @nilsen last edited by

        @nilsen maybe that's an outdated function, I can't find it in documentation..

        https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradebuy

        https://www.mql5.com/en/docs/trading/ordersend

        Need small help? Tag me in your post
        Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

        N 1 Reply Last reply Reply Quote 0
        • N
          nilsen @roar last edited by

          @roar Thanks for the response but those functions give me compilation errors:
          "
          Compilation errors
          'Buy' - undeclared identifier
          ',' - unexpected token
          '0.1' - some operator expected
          ')' - unexpected token"

          roar 1 Reply Last reply Reply Quote 0
          • roar
            roar @nilsen last edited by

            @nilsen ah, I noticed it too. I don't really know about this then, I'm starting to fear its not possible in "Custom MQL code".
            Making your own blocks in fxdreema studio would allow to use mql in "global scope", whatever that means. But I can't really help you further..
            https://fxdreema.com/studio/

            Need small help? Tag me in your post
            Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

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

            Online Users

            O
            A
            J
            M
            R
            F

            18
            Online

            146.6k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors