The best way to close buying and selling
-
I want to know if these equations are correct? My problem is in the negative value of buying and selling, I don't know if it is correct or not?
Please help and thank you everyone
https://fxdreema.com/shared/Z7ohBSl3 -
@khalids222 Why are you using a bucket of trades when you specified just the last open trade on both 'For each trade' blocks? If I understand correctly, you are trying to close all buys and sells when a specific profit is hit. Why all those complex calculations and not using a simple 'check profit (unrealized)' block instead?
-
@l-andorrà In the event that the trend is bullish, for example, the purchase will be closed more than once and the sale will not be closed, if we assume that the value of the sales transactions are large despite the closure of the purchase, the total will be a great loss.
So this simple method you are talking about is inappropriate here.
But the second option, if you calculate each time the total loss and profit for both parties, the buying deals will not be closed until their profit is higher than the selling trades, so that I guarantee that when the price rises, the purchase and selling will not be closed at a greater loss.
I want to close when the total BUY is more than the total SELL value or vice versa
to close buy : profitbuy(10) - profitsell(-15) = R1(-5)
R1 > 1
CLOSE BUY -
@khalids222 Ok. But if I understand what you mean correctly, you don't need to know how many open trades are in profit or in loss, right? You need to take all open trades in profit and then compare them to all those in loss. That is exactly what the block is doing. I don't understand why you say it doesn't work in your case.
-
@l-andorrà said in The best way to close buying and selling:
Ok. But if I understand what you mean correctly, you don't need to know how many open trades are in profit or in loss, right? You need to take all open trades in profit and then compare them to all those in loss. That is exactly what the block is doing. I don't understand why you say it doesn't work in your case
Yes, what you understood is correct, I did not say that it does not work, but my problem is only when the two sides are negative. Here the value changes
My only problem is math
profitbuy(10) - profitsell(-15) = R1(-5)
Here is a market that closes at a loss -
@l-andorrà
I think that the method of calculating by incrementing a positive number over the sum is incorrect, and this is the cause of the problem, because the result may also be negative.
I think this way is correct but I don't know if it works well
FOR CLOSE BUY:
profit buy - profit sell = R1>+1
FOR CLOSE SELL : PROFITSELL - PROFIT BUY = R2> +1