Is it possible to backtest a number of given trades/trade setups?

Created at 24 May 2019, 13:28
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
ER

erik.lindblad

Joined 05.03.2019

Is it possible to backtest a number of given trades/trade setups?
24 May 2019, 13:28


Hi!

I don't know if my case is unusual or not but I would NOT like to backtest a bot that finds trade setups based on some trading strategy but instead backtest a number of given trade setups. For example, given 100 trade setups in a csv-file including timestamp, entry price, buy/sell, tp and sl I would like to see what the outcome of these trades was during that period. 

I am new to backtesting in ctrader/calgo so I just want to know if it is possible before investing too much time.

Any input appreciated. Thanks!

Regards Erik


@erik.lindblad
Replies

PanagiotisCharalampous
24 May 2019, 15:36

Hi Erik,

I am not sure what do you mean with trade setups. Could you please give us an example of what would be in the csv file?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
24 May 2019, 15:46

Hi again,

Ok I read your description again. What you describe is possible. You can write a cBot to read entries from a csv file and place orders accorningly. However timestamp and entry price are bit contradicting. Either you will specify an entry time and get the market price or you will specify a trigger price enter the market whenever the condition is met.

Best Regards,

Panagiotis


@PanagiotisCharalampous

erik.lindblad
24 May 2019, 16:04

Hi and thanks for your reply!

Let's say I have 100 trades from January 2019 in a csv file. I want to know if these trades were wins or losses if they would have been placed at the given time/price.

File content could look somehting like this (date, time, symbol, type, price, sl and tp:

2019-01-05 05:32:456 EURUSD BUY, 1.1192 1.1170 1.1220

2019-01-06 22:32:123 CADJPY SELL, 84.20 84.50 83.50

etc ...

Could I get the outcome of these trades using backtesting functionality in cTrader/cAlgo?

Hope that was clear.

/Erik


@erik.lindblad

PanagiotisCharalampous
24 May 2019, 16:16

Hi erik,

I don't see any obstacle in doing this. All the required infromation is there.

Best Regards,

Panagiotis


@PanagiotisCharalampous

erik.lindblad
24 May 2019, 16:30

RE:

Panagiotis Charalampous said:

Hi erik,

I don't see any obstacle in doing this. All the required infromation is there.

Best Regards,

Panagiotis

Thanks for your reply! I did not see your other reply until after my last post. Good news I can use a cBot for this! Yes, I get your point that price and timestamp are a bit contradicting. Maybe better to simulate a market order at the given timestamp.

Two more questions if you do not mind:

1. Can I mix symbols in the file or do I need to run once per symbol and then sum up the results?
2. Just to point me in the right direction, can I do this using the built-in backtesting features?

/Erik


@erik.lindblad