fxDreema

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

    Buy stocks worth fixed amount of money

    Questions & Answers
    2
    3
    190
    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.
    • B
      bimsbrohm last edited by

      Hi everyone,
      I'm programming a simple EA that opens long or short positions (stocks CFDs) following a signal from an indicator. The EA shall be connected to different symbols in MT5. For example, I will have an EA on an Apple chart and an EA on a Facebook chart. Let's assume an initial account balance of 100.000€. I'd like the Apple EA to buy 5.000€ worth of stock. At a stock price of 150€ the EA would buy 33 stocks. Then the Facebook EA receives a buy signal and it also buys stocks worth 5.000€ - in this case it buys 25 stocks.
      After 20 such trades my balance will be zero and the EA stops buying since there's no more money in the account. It will continue to buy only after some positions have been closed and the balance is >0.

      My question: Is there a way in fxDreema to make this work. I couldn't find this under money management. I tried "Risk fixed amount of money" but didn't get anywhere.

      Any help is much appreciated!

      Thanks
      Adrian

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

        you would have to think in terms of balance % and divide by the # of stocks you anticipate trading in.

        1 Reply Last reply Reply Quote 0
        • B
          bimsbrohm last edited by

          Hey @TipsyWisdom , thanks for the input. The problem with % of balance as I see it: The actual amount that is used for buying shares gets smaller and smaller after each trade since the balance as a whole gets smaller. My goal is to always buy for the same fixed amount of money. It seems so easy and obvious but I wouldn't know where to look within MT...

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

          Online Users

          K
          A
          A
          M
          V
          E
          M
          B
          E
          R
          A
          V
          O
          R
          O
          H
          M

          24
          Online

          146.8k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors