cuemacro/finmarketpy

spread trading costs

mg64ve opened this issue · 5 comments

Hi,

nice library! I have a question, is finmarketpy considering spread trading costs?

Kindly let me know.
Thanks.

Regards.

Hi, yes you can add transaction costs in your backtesting model. Under the load_parameters function, you can define br.spot_tc_bp = 0.5, for example, to add the transaction cost into the trading.

Thanks ShihHauTan, what does 0.5 stand for? Is it PIPS or percentage?
How are trading costs calculated?

@ShihHauTan one more question: walk-forward testing for machine learning models, is it implementable in finmarketpy ?

I think that is probably something you can implement in finmarketpy (but it isn't there at the moment)

Thanks @ShihHauTan , sorry for so many questions but, before dedicating a lot of time and finally find that is not be feasible, I'd prefer to ask.
What I want to do is to build a machine learning model within in-samples dataset and then test it in ot-of-samples dataset.
Do you think it is feasible with a simple loop?
Do you have an example of simple machine learning strategy?