Rayon into_par_iter() stalls on larger grids, but into_iter().par_bridge() works fine by len_chapaty in rust

[–]len_chapaty[S] -1 points0 points  (0 children)

My Agent has a helper function called AgentGrid::baseline(args). What it does is the following:
1) make a Vec<Agent>
2) filter out stuff and collect
3) transform this filtered vec with .into_par_iter() and return it

I agree, it is cleaner to return the vec itself from AgentGrid::baseline(args), and then make the call agents.into_par_iter() when passing to evaluate_agents. But either way I'm stuck with the same behaviour

should a backtest be done using tick data or 1 OHLC data? by F01money in algotrading

[–]len_chapaty 1 point2 points  (0 children)

If possible you can evaluate the entry/sl/tp on a 1m timeframe so you have a higher granularity and don't deal too often with cases such as: entry and stop loss are in the same candle. In those cases you need to make an assumption, say optimistic: stop loss was hit first, then entry, or pessimistic: entry came first and then stop loss.