Replies

3eunguyen
25 Mar 2021, 21:46

RE: RE: VolumeROC only works OnTick()

amusleh said:

3eunguyen said:

Sorry for the noob question.

I'm running this cBot, where I just print the last value of the VolumeROC indicator to the log. When I backtest it and compare it to the value of the exact same indicator that I display on my chart, I get completely different values. It keeps printing negative numbers around -80 and -99 in the log.

Can you post your cBot code here? the Volume ROC can go in negative side.

 

It's good, turns out VolumeROC won't work if you run it inside OnBar(), it has to be OnTick(). That kinda sucks, I hope it doesn't affect all volume indicators.

//Doesn't Work  

protected override void OnBar()
        {
            Print(vRoc.Result.LastValue);
        }

//Works

protected override void OnTick()
        {
            Print(vRoc.Result.LastValue);
        }


@3eunguyen