The Choppy Market Index (CMI) is an indicator which compares the difference between the close of the current period with the close X periods ago and normalizes this against the range (highest – lowest) of that period. The value of the indicator is finally multiplied by 100 to give a number between 0 and 100. The formula of the indicator is highlighted below :
CMI = ((|Close Current period – Close X periods in the past|)/(Highest point in X periods – Lowest point in X periods))*100
Following is my code for NT but for some reason I am not able to see any line or result. Can someone please tell me what am I doing wrong here?
protected override void OnBarUpdate()
{
Value.Set(((Math.Abs(Close[0]-Close[50]))/(MAX(50)[0]-MIN(50)[0]))*100);
}
Thanks
Comment