Calculate commission on an account that does not show a commission charged because it is a demo account.
-
Hello I'm trying to simulate that I'm paying commission of 0.07 cents for each trade.
What I tried to do in this project is first get the amount of trades that happened on the day of (today).
Then I try to multiply the amount of trades by the amount of commission per trade and get the result.
Next I'm trying to get the total profit value of all these trades that happened on the day of (today).
And finally, calculate the profit or loss + the result of the total commission.I noticed it's getting everything wrong:
In the picture it shows 165 trades, but I actually have 159.
The total profit is 15.12$ and in the picture it shows 6.51Can you help me understand if there is something wrong with my logic or calculation?

-
@ontradingx
PROJECT HERE --> https://fxdreema.com/shared/NQzEZDrNd -
In fact you are loading orders from yesterday.
In the "Bucket..." block you are using Time A and Time B as time boundaries. Time A is the time of candle 1, and Time B is the time of the current candle. Today is 17 Feb, but guess what is the time of candle 0? Just go with the mouse over that candle, it shows 2023.02.17 00:00. And the time of candle 1 is 2023.02.16 00:00.
In other words, for today (2023.02.17) your times are as follows:
- Time A = 2023.02.16 00:00:00
- Time B = 2023.02.17 00:00:00
You can add "+86400" in the Adjust fields of boths times, this will move them one day ahead (86400 is the number of seconds in 1 day).
I tried to set candles 0 and -1, but -1 doesn't work, as there is no candle in the future.
Or, you can set candle 0 for Time A, and for Time B set Value->Time->Now for Time B (or just disable Time B filter).