Thank you! But I have another problem on the TimeNum().
How do I correct it? Covert TimeNum to an array?
Error 6. Condition in IF, WHILE, FOR statements has to be Numeric or Boolean type. You can not use array here, please use [] to access array elements
If I want to write "when Average True Range > 2 AND Time < 3pm then Buy"
AvgTruRange = ATR(40);
for (i = 0; i < BarCount; i++)
{
if (AvgTruRange >= 2)
if (TimeNum() < 150000)
Buy = Cover(Close, BuyStop);
}
How do I correct it? How to convert TimeNum() to an array?