I have a variable I'm attempting to increment from 0 when a certain condition is achieved. It seems to work, but since it's in the "if (FirstTickOfBar)" area, it increments it twice. I discovered this in the Log file after going through a market replay session.
Here's what the code looks like. FYI, COBC is false.
if (FirstTickOfBar)
{
if (volume > volMA_14 * 2)
{
volumeSpikes++;
Print("volumeSpikes is now " + volumeSpikes + ".");
}
}
When this condition is met, volumeSpikes shows up in two log entries.
It first says "volumeSpikes is now 1" on the first line, with a timestamp of 9:57 AM.
The second says "volumeSpikes is now 2" on the second line, with a timestamp of 9:57 AM.
Any ideas on this one? Thanks in advance for any advice and your time!
Yours,
Spider
Comment