Trying to describe my issue below. Thank you in advance for giving me a bit of your time.
Aim :
-----
1. Find when width of bands was the lowest, in the last 50 days.
protected override void BBwidth()
{
Calculate BBwidth = (Bollinger(2,20).Upper[0] - Bollinger(2,20).Lower[0])/SMA(20)[0];
}
protected override void OnBarUpdate()
{
Print (MIN(BBwidth(2,20), 50)[0]);
}
2. Print date on which width was lowest. (Not sure how to.. is it possible?)
========================================
I am (still) struggling with the 'Strategy Analyzer' (Backtest -> Timeframe)
My idea is that I should specify a timeframe where there is atleast 50 candles.
For example if i specify timeframe as 01/01/2015 - 03/06/2015.. does the loop start from 01/01/2015 and look at 50
previous candles to calculate MIN ? This is not what i want. I would like the MIN of 50 previous days from the latest trading day (03/06/2015 as of now).
If i specify timeframe as 03/06/2015 - 03/07/2015 (with Onbarclose = false; and MinBarsRequired = 0; ) I am not able to get any results in the Output window.
Could you help me with points 1. and 2. , please ?
Thanks a lot,
Vin
Comment