Hey Rene, thanks for pointing me in the right direction, I ended up changing a few things around to get it working. here is the updated code snippet - cheers int bars = iBars(_Symbol, HIGHLOWTRIGGERTIMEFRAME); if (totalBars != bars) { totalBars = bars; Comment("DownTrend: ", isDownTrend, "\nUpTrend: ", isUpTrend); // Remove previous objects (if any) ObjectsDeleteAll(0, "HighCircle"); ObjectsDeleteAll(0, "LowCircle"); double highs[]; ArrayResize(highs, 2); // Initialize the dynamic array for highs double lows[]; ArrayResize(lows, 2); // Initialize the dynamic array for lows // Reset the dynamic arrays to zero ArrayInitialize(highs, 0); ArrayInitialize(lows, 0); for (int i = 0; i < MaxLookback; i++) { if (i > BarsN && iHighest(_Symbol, HIGHLOWTRIGGERTIMEFRAME, MODE_HIGH, BarsN*2+1, i-BarsN) == i) { double high = iHigh(_Symbol, HIGHLOWTRIGGERTIMEFRAME, i); string objectName = "HighCircle" + IntegerToString(i); ObjectCreate(0, objectName, OBJ_ARROW_UP, 0, iTime(_Symbol, PERIOD_CURRENT, i), high); ObjectSetInteger(0, objectName, OBJPROP_COLOR, clrRoyalBlue); ObjectSetInteger(0, objectName, OBJPROP_FILL, clrRoyalBlue); // Store high values in the dynamic array for (int j = 0; j < ArraySize(highs); j++) { if (highs[j] == 0.0) { highs[j] = high; break; } } } if (i > BarsN && iLowest(_Symbol, HIGHLOWTRIGGERTIMEFRAME, MODE_LOW, BarsN*2+1, i-BarsN) == i) { double low = iLow(_Symbol, HIGHLOWTRIGGERTIMEFRAME, i); string objectName = "LowCircle" + IntegerToString(i); ObjectCreate(0, objectName, OBJ_ARROW_DOWN, 0, iTime(_Symbol, PERIOD_CURRENT, i), low); ObjectSetInteger(0, objectName, OBJPROP_COLOR, clrRed); ObjectSetInteger(0, objectName, OBJPROP_FILL, clrRed); // Store low values in the dynamic array for (int j = 0; j < ArraySize(lows); j++) { if (lows[j] == 0.0) { lows[j] = low; break; } } } }