fxDreema

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

    please help

    Questions & Answers
    3
    8
    1034
    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.
    • Zackry
      Zackry last edited by Zackry

      i am trying to use the lotsize based on the stoploss and the stoploss is 3 times the atr pips so whatever the stoploss is it just calculates and then risk 5 percent of the account depending on the stoploss
      something like this0_1562670827609_Screenshot_3.png

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

        @miro1360 @fxDreema @l-andorrĂ  @roar

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

          It should be integrated in the buy/sell block:
          0_1562689041419_2dbe1145-e450-4b71-bcbb-18f5f3d6b06d-image.png

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

          Zackry 1 Reply Last reply Reply Quote 0
          • Zackry
            Zackry @miro1360 last edited by

            @miro1360 yes but the problem is, I want to display the calculated lot size on the chart before the trade is opened its kind of a partial automated system, and the trade is taken when I click on the button that I created, but before clicking on the button I want to k ow what will be the lot size of this particular trade

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

              Money management calculations happen inside the block and they can't be accessed from outside. If you want to display some information and then use it in particular block, then you should make the calculations outside this block.

              By the way, in the past I was thinking about a little bit different way of opening trades. To have one Trade block Instead of Buy and Sell blocks, and some other block for doing the SL/TP calculations, and another block for the lot size calculation. In other words, instead of having all-in-one block, to have multiple block, one for each step. But my reasoning for this is not to be able to get some data (lot size, sl, tp) before buying or selling. I was thinking about this so we can connect one chain of blocks and that chain to be able to work for the buy part and for the sell part. Because now very often we have the same sets of blocks for both sides.

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

                @fxdreema thats a very good idea to have all these things in separate chain of blocks it will give us more flexibility and possibilities
                and about my question i know i cant use the calculations from buy/sell blocks anywhere else and i will have to perform separate calculations to display that on chart , i dont know where to start that calculation

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

                  The calculation is a little bit complicated, yes. This is mine:

                  size=((value/100)*AccountEquity())/(sl*((TickValue/ticksize)*point)*PipValue(symbol))
                  

                  This is part of the code where this is calculated. size is obviously the result that we expect, in lots. value is the input value, the % to risk. sl is the stop loss, I think in pips. The rest of the formula is to make sure that everything works in any chart. Here are some of the variables:

                     double TickValue=MarketInfo(symbol,MODE_TICKVALUE);
                     double point=MarketInfo(symbol,MODE_POINT);
                     double ticksize=MarketInfo(symbol,MODE_TICKSIZE);
                  

                  what is tickvalue and what is ticksize... I don't really remember đŸ™‚ I think point is 0..00001 if the broker is 5 digits. PipValue() is a function that I wrote and this function makes it possible for these settings to work:
                  0_1562694269847_f39d7605-504e-49f8-bf69-072662a6ca32-image.png

                  So obviously these are some crazy calculations. They can be simple if you omit all these tick value/size, pip and point things.

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

                    @fxdreema from the looks of it , i believe its for a fix sl value. Right?

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

                    Online Users

                    J
                    T
                    J
                    B

                    22
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors