I want more calrification on the meaning of the nbars?

I want more clarification on the meaning of the nbars  and why it is impacting the value of the Return?



history(assetscolumnsnbarsfrequency)

  • assets (asset object or a list of assets.) – An asset or a list for which to fetch data.
  • columns (str or a list.) – A field name or a list of OHLCV columns.
  • nbars (int) – Number of bars to fetch.
  • frequency (str) – Frequency of bars (either ‘1m’ or 1’d’).

Hello Ahmed,



Blueshift is great to backtest strategies so we are happy you are learning this. 



nbars can be understood as the number of data periods you want to get as per the frequency you ask.



So, for example, if you ask for daily frequency, and, say, you put nbars= 5, then you will get 5 days of the asset's data. In case you ask for minute frequency the "Close" column, you will get 5 close prices each from a different minute.



I hope that helps,



Jose Carlos

It is clear now , Thanks