fxDreema

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

    lot size calculation

    Questions & Answers
    2
    13
    3496
    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.
    • R
      RobinURSS last edited by

      hi,
      the last problem with time filter is history, i use now the the backtest with ticks.

      But i need that the lot size of each order is calculated on a certain money amount.

      For example, instead puting a fixed lots amount in the buy now block, i want to use a fixed money amount how could it be posible?

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

        So you want to convert money amount to lots size. This happened automatically before, but I removed it as an option, because there were problems when the requested lot size was bigger than 1000. No one complained 🙂 The simplest way is to divide the money amount by 100000 (which is the money amount for 1 lot in most currencies)

        1 Reply Last reply Reply Quote 0
        • R
          RobinURSS last edited by

          See what i have to do to fix that error u made deleting that option 😉

          https://fxdreema.com/shared/f8z8Wvu8e

          What i do then, is use the result from block 232 on the buy now block .

          Is it correct? do u think im going to have any problem?

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

            Meh... so much formula blocks. Why do you want to do it like that by the way? Maybe you want to do something that you don't really want to do 🙂 And maybe the thing that you want to do can be done in some much easier way.

            1 Reply Last reply Reply Quote 0
            • R
              RobinURSS last edited by

              Well if u have a better way to do it, what are u waiting for to tell me taht way??

              I need that function because all the trades have to risk the same amount of the balance i.e. 2% have to be used for each trade on 13 different pairs... but wait.. im thinking.. may be i can sue the function of buy now block that says"% of Balance" if that is correct... what a way to complicate things hahah

              1 Reply Last reply Reply Quote 0
              • R
                RobinURSS last edited by

                By the way, i made a backtest on major pairs and the first idea worked perfect!

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

                  __Well if u have a better way to do it, what are u waiting for to tell me taht way??

                  I need that function because all the trades have to risk the same amount of the balance i.e. 2% have to be used for each trade on 13 different pairs... but wait.. im thinking.. may be i can sue the function of buy now block that says"% of Balance" if that is correct... what a way to complicate things hahah[/quote:1d7bphad]

                  That was what I wanted to say. There are few MM models already build in trading blocks. But even if you don't like some, you can select Fixed and put some formula in the input field. For example, I was using something like this in one project that I tried: AccountBalance()*0.3/10000.

                  AccountBalance() = the current balance
                  AccountEquity() = the current equity

                  Those are also available if you select them as "Custom value". Then you can use "Adjust" to adjust the value if needed....

                  I don't know what exactly to show you because in your example you are mixing price value (Ask, Bid) with money, which is a little bit... deep water.

                  1 Reply Last reply Reply Quote 0
                  • R
                    RobinURSS last edited by

                    That about % of Balance.. wasnt what i was saying...

                    May be u ddint get the idea... it is like this: i want to risk exactly 100usd per position on each pair. Suppouse i have GBPUSD and EURUSD and i want to buy on each one, and i want to risk just those 100usd, then i should have a certain amount of lots calculated based on the current price of the pair and the money. Then u havent any function like that.. i know it is something like frustrating that someone tell u smoething like this right now, but u should see the difference if use a kind of system like this with 13 different pairs for 1 year....

                    But as i though and though all the night, that "deep water" or whatever i have better to the perfection the last example i gave u.

                    https://fxdreema.com/shared/uGBPohqLb

                    Now i just use the result of block 232 and works perfectly for any buy now or buy pending block for the majors pairs or usd pairs, just choosing result 232, and it realy work on backtests at least.

                    You should make that example a compact block.

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

                      % of Balance => Lots - when set to 100%, on EURUSD this will buy 0.01 lots if you have 1000 dollars. Here the idea is that 1000 dollars = 0.01 lots. On other symbols... who knows.
                      Risk % of Balance - lot size will be calculated depending on SL, so when SL is hit to lose this % of the balance. Well, not exactly, because you know that lot sizes have steps.
                      Freeze % of Balance - this depends on your free margin.

                      This is one of the functions that calculates lot size... if you can understand something: https://fxdreema.com/documentation/coll ... ynamiclots

                      1 Reply Last reply Reply Quote 0
                      • R
                        RobinURSS last edited by

                        i have a long time using this platform and i can understand very well that 3 settings of MM and i can ensure you that there is something missing. For example if i buy 1 lot on eurusd it will use around on 1070 usd at current price on eurusd, and if buy 1 lot on gbpusd it will use 1428 usd of my acc. Then iam not risking the same money on both pairs for the same stop lose...did u get it?
                        What i mean is, i say to the expert that i want to use just 1000usd on each pair for each trade, then it should calculate the proper lot size for that amount.

                        But dont worry i solved the rpoblem with that example.

                        Now i have a new thing for the same expert that i dont know how to make.
                        Also i dont know if it should be a aprt of the ea or and extra indicator that i can put on the chart when im using the ea.
                        I want to make a window on the chart where appears a graph of the profits of the trades on that pair.
                        I have no problem consulting the data i need to do it with a simple loop, but i dont know how to draw it on the chart...

                        thanks

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

                          You are talking for what option? You wrote % of Balance above, but there are at least 3 MM options containing words **% of Balance ** in their name and they are totally different 😮


                          I think it's only possible for indicators to create extra window: http://forum.mql4.com/64721#988426

                          1 Reply Last reply Reply Quote 0
                          • R
                            RobinURSS last edited by

                            __You are talking for what option? You wrote % of Balance above, but there are at least 3 MM options containing words **% of Balance ** in their name and they are totally different 😮


                            I think it's only possible for indicators to create extra window: http://forum.mql4.com/64721#988426[/quote:1wekiz5m]

                            Forget that about % Balance i was refering to those 3 and i know what they do a different thing, but even is a 4 situation as i explained you on the other example. But i can do it normaly with the past shared link i sent you.


                            How can i creat that separated window with fxdreema? i know i have to start the project as a indicator instead of an ea. Then i can realise that on the objects block section, on the settings of each one of those blocks there are some settings called "Chart ID (where to draw)" set uo to "0" and "Chart sub-window ID" set up to "0"... i suspect that i can creat a separet window for thats objects modifying thats settings may be?

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

                              fxDreema generates EAs and Scripts, but not indicators. There are some differences.

                              You can generate empty indicator in MetaEditor, it's pretty easy and happens in 5 seconds. I did that and here is the result: http://prntscr.com/6p5skx
                              Chart ID... keep it 0. Sub Windows is what matters here. The main chart is 0, the first sub window is 1 and so on.... http://prntscr.com/6p5tdj

                              But the need to have separate window can cause you some problems if you want to backtest this, because no separate window will exists and you will not be able to work with these objects

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

                              Online Users

                              J
                              S
                              W
                              A
                              H
                              H

                              15
                              Online

                              146.7k
                              Users

                              22.4k
                              Topics

                              122.6k
                              Posts

                              Powered by NodeBB Forums | Contributors