fxDreema

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

    Need help for a project

    Questions & Answers
    2
    9
    2640
    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.
    • E
      ezzakt last edited by

      Hello site admin,

      first of all, gratulations to your amazing software. I tried all the other EA creators before finding yours and fxdreema is the only one providing the flexibility needed to create EAs.
      Just bought it.

      I have a problem completing a project. Attached the project file for review if you can help me.

      What the bot should do:

      1. Open 1 pending buy and 1 sell. Defined lets say 20 pips away from price.
      2. Now the bot is a price follower. If price triggers a pending, the other pending is deleted and 2 new ones are created both again 20 pips away from that point then.
      3. A multiplicator formula is used here, so every pending order is multiplicated by 2 in volume size. (somehow I am not able to use values like 1.5, or 1,5....seems to work only with a full number)
      4. Now it has a trades loop to check all open trades for a profit defined in account currency. In the project file its set to 100
      5. If this is reached, it should close ALL trades, and start again from the scratch.

      It seems to work until the point where it should close trades if profit ammount is reached, this does not work in the backtests I tried. I did not try this yet on a normal demo account though.

      Can you give me a hint please why this is not working the way it should ? Might this be a backtesting issue or is my logic defined wrong ? Thanks in advance

      Andy

      ......
      pat.zip

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

        You have a chain "Start trades loop -> (in loop) Check profit amount -> Close each trade" and that means it will reach to the "Close each block" only if one of the trades has profit above 100 dollars.
        But I think you want to close all trades when the total profit is more than 100 dollars. In this case you can add "Condition" block comparing "Accout Information -> Profit (current unrealized)" with 100.
        By the way, note that the initial value of your lot sizes is 0, because Result12 is still not set. That causes to work with the minimum lot size.
        For the increment step - it depends on the lot step size. If it is 0.01, you can open 0.01, 0.02, 0.03 lots... but no something like 0.015.
        I can also suggest you to use Variables instead of Formula block.

        1 Reply Last reply Reply Quote 0
        • E
          ezzakt last edited by

          Thanks for the reply

          Attached a new project file
          I tried the condition block with "trades in loop" and without, it seems not to work with closing the trades at 100 Profit. Can you please have a look ?

          For the formula part, I am not sure I understand. In the backtest it looks like it is multiplying with 2 correctly, but just not closing the trades correctly.

          Cheers
          Andy

          ......
          pat.zip

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

            http://fxdreema.com/shared/D81180hH

            1 Reply Last reply Reply Quote 0
            • E
              ezzakt last edited by

              thanks!

              It still does not seem to work in a backtest as it should. Its not closing right.
              But as this could be backtest related, let me check that on a Demo when markets come back online.

              I will post results tomorrow.

              Cheers
              Andy

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

                Well, if "Close each trade" is executed and there is nothing closed, this will probably lead to error messages. Do you have error messages in Journal?

                1 Reply Last reply Reply Quote 0
                • E
                  ezzakt last edited by

                  Hello,

                  I have now let it run on a Demo for 1 day.

                  It looks like everything is working, including closing logic IF there is only 1 trade open. I saw it closed 3 trades perfectly with 100 in profit, but there was just that single trade open.

                  I saw it closed this night a basket of 8 trades, but this time in sum with a profit of 500 and not 100.
                  So what I see in backtests is the same, sometimes it closes with the 500, sometimes with a minus, sometimes with a completely different plus. The closing logic seems to fail when more than 1 trade is open.

                  I used the ex4 from your example provided for this test. Do you have any idea what is happening here ? I have no errors in the log at all.

                  Regards
                  andy

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

                    __I saw it closed this night a basket of 8 trades, but this time in sum with a profit of 500 and not 100.[/quote:2si2fpxi]

                    I think you miss some information about the pink blocks (Start "whatever" loop). These blocks self-repeats as many times as many trades/orders/history trades are present at the moment. Each of these blocks has optional filters inside to make them pass only for those trades/orders/history trades that you like. And the reason why these blocks exists is to manipulate trades/orders/history trades one by one in a loop (cycle) that exists within a single tick.

                    I don't think you need these blocks. Maybe only this one (#13) before Formula block. You can set "Not more than n orders" to 1 inside.

                    In your project (the first one posted here) you use trades loop to check trades one by one for profit more than 100. In this case you will reach the closing part when one of the trades profits more than 100. But in the same time there can be other trades with some amount of profit, and when they are closed - the total profit will be different than 100.

                    That's why I suggested to check total unrealized profit - this is the sum of profits from all available trades. The only problem now comes from the increasing size of lots which will not cause problems in backtesting, but on demo or real... who knows.

                    Check this: http://fxdreema.com/shared/iH1QDr7ze
                    It works on my backtester... to the point where it can't reach the profit of 100 dollars anymore because there is not enough money to trade with increased lot size 😕

                    1 Reply Last reply Reply Quote 0
                    • E
                      ezzakt last edited by

                      Hi there,

                      sorry for the late reply.
                      I did test the strategy you created and thats exactly what I meant. So the function works as expected.

                      And yes you are right, that strategy is not final 😉
                      Found some good settings while optimizing in backtester, but the strategy needs some more logic to get better...have to think about that

                      Thanks again for your help, cheers

                      Andy

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

                      Online Users

                      N
                      C
                      S
                      S
                      P
                      C

                      12
                      Online

                      146.7k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors