Greetings!
I'd like to make the custom Forex comission. It's not a problem to set commision and spreads in Calculate method of my comission. But I have a problem to calculate swaps. Because they depend of the position time in days.
Any ideas how to calculate the position time in comission?
Size:
Color:
I'm not familiar with swaps. How does the length of time that a Position is held affect the commission?
The only potential idea I can come up with is to store a List of something in the Bars.Tag that you can retrieve in Calculate(). Still I don't know how you'd identify an exiting trade or how long the Position was held unless you used different tradeType and/or orderType between entries and exits.
Size:
Color:
OK, Here is the scenario.
1. We open the trade
2. When we move to the next day there will be the swap. It's like a comission we pay each trading day for our position. But swaps can be positive. It means that we can earn the money. Swaps calculate each day except from Friday to Saturday and from Saturday to Sunday. Also there is 3x swap from wednesday to thursday.
3. We close the trade
So we need to calculate the comission not only on open and closing trades, but also on each new day. Or we need to know on closing the start day of he trade. In this case we calculate the swap on exit.
Size:
Color: