for(idx = 0; idx < askRows.Count; idx++) { totalaskvol += askRows[idx].Volume; } for(idx = 0; idx < bidRows.Count; idx++) { totalbidvol += bidRows[idx].Volume; } Print("total bid vol:\t" + totalbidvol); Print("total ask vol:\t" + totalaskvol); if(totalbidvol != 0 && totalaskvol != 0) { bidaskratio = totalbidvol/totalaskvol; } Print("ratio:\t" + bidaskratio);
the totals calculate right, but the ratio doesn't.
see below for two examples:
total bid vol: 204 total ask vol: 167 ratio: 1 [ratio should be 1.2215] total bid vol: 160 total ask vol: 167 ratio: 0 [ratio should be 0.958]
what am i doing wrong here?
Comment