Controlling two parts - Buys side and Sells side
-
Hello
Because the modification of the Take Profit calculation get mixed up working with the sells and buys together I want to separate the sides... Buys only and sells only. In other words, When the buy condition is activated then ONLY the buy side will work and when Sell condition is activated ONLY the Sell side will work. The OR, AND and IF function does not work in this case, I already tried.
https://fxdreema.com/shared/qLh0njCEcRegards and Thank you
-
@alphaomega Put a blue check trades count block above the buy and sell, for buys check sells => 1, for sells check buys => 1.
-
@jstap Thx for the reply... I cannot do that because the expert works on averaging.. so if I do the Check Block it will mess-up the count of the pips away from open price. Have you run the expert? Please check how it runs. There is a similar project on another project.. Let me check where it is
https://fxdreema.com/forum/topic/8947/can-i-set-my-buy-sell-ea-to-only-buy-or-only-sell
but I cannot use it here.. -
@alphaomega I haven't but you said allow only buys when buys activate, by putting the check block at the top of the tree the whole tree will not work when the opposite trade is running.
-
@jstap .. brother, I do not care about how many trades the expert makes because I have that covered. My problem is with the mistakes the algorithm

starts having, if you take sells and buys together. I have gone so far as to create groups as to help the workings not get mixed-up but it does not help, it still mix-up the buys and sells average.
If I create ONLY buys then the averaging algorithm do not make mistakes and so also with ONLY sells, BUT, when the two works together that's where the algorithm starts making mistakes. So I need a way to keep the Buys and Sells apart. When there is a BUY condition the Sell side must be put off, and visa versa. -
@alphaomega I am lost because I showed you how to stop the other type of trades from running, meaning your code would work as expected.
Use bucket of trades or pink for each trade to get the values you want for both buy and sell separately.
-
@jstap Ok, I understand that you will be lost if you did not run the expert to see everything that I explained above happening. I understand that the advice that you have given is the correct advice in normal circumstances, but it will not work because in this instance the the Buy side and the Sell side use the same MQL block. This is the biggest problem.. would you do me a favor please.. Rewrite the Sell part of the expert using the same blocks but with other variable names and such. I have also done this in Group1 and Group2 but I struggle for the expert not to use the MQL block simultaneously for Buy and Sell,

-
@Jstap Thank you very much for all your input .. I have this problem solved now.
I had to connect both sides of the algorithm to the Check trades block

-
-
@alphaomega Looks good:)
-
@jstap maybe you have a good strategy I can test?... the skeleton works like a bomb now
-
@alphaomega you mind sharing bro

