rlohmeyer
Active member
Hi,
This is code for a volume signal to tell me which bars have either volume greater than the last 5 bars (not based on an average but by looking at the volume for each of the previous 5 bars and comparing to the present bar). I am using this instead of having to move attention off price action and allows me to assess what I would refer to as commitment based on the bar and the signal. These often assist in showing potential exhaustion of a move or lack of commitment to the continuation of a move.
The one issue I have with the code that I would like some assistance with is the fact that the signal for a low volume bar is placed incorrectly. Since assessing low volume would show the signal at the get go on a bar I had to make the assessment of low volume after the completion of the bar, and the code reflects that. However, the placement of the signal should be previous bar, rather than the present bar. I have searched for a way to move the signal back by one bar but could not come up with a way. If any of you great coders coder could help, would appreciate it.
Here is a chart of NVDA for todays trade which shows the indicator at the low of 3 bars that would give useful information as to the potential for a brake out above the VWAP.
The code is useful as is but if anyone can adjust so that the signal on the low of each bar can be auto moved back by one bar it would make assessment easier and quicker. Thanks. Here is the image and the code below it. PS: the code skips the first 30 minutes of trade as the opening range period, which I don't trade.
This is code for a volume signal to tell me which bars have either volume greater than the last 5 bars (not based on an average but by looking at the volume for each of the previous 5 bars and comparing to the present bar). I am using this instead of having to move attention off price action and allows me to assess what I would refer to as commitment based on the bar and the signal. These often assist in showing potential exhaustion of a move or lack of commitment to the continuation of a move.
The one issue I have with the code that I would like some assistance with is the fact that the signal for a low volume bar is placed incorrectly. Since assessing low volume would show the signal at the get go on a bar I had to make the assessment of low volume after the completion of the bar, and the code reflects that. However, the placement of the signal should be previous bar, rather than the present bar. I have searched for a way to move the signal back by one bar but could not come up with a way. If any of you great coders coder could help, would appreciate it.
Here is a chart of NVDA for todays trade which shows the indicator at the low of 3 bars that would give useful information as to the potential for a brake out above the VWAP.
The code is useful as is but if anyone can adjust so that the signal on the low of each bar can be auto moved back by one bar it would make assessment easier and quicker. Thanks. Here is the image and the code below it. PS: the code skips the first 30 minutes of trade as the opening range period, which I don't trade.
declare upper;
input OpenTime = 0930;
input OpenRangeMinutes = 30;
def OpenRangeTime = if SecondsFromTime(OpenTime) < 60 * OpenRangeMinutes then 1 else 0;
def v = volume;
def sigh = if !OpenRangeTime and v > v[1] and v > v[2] and v > v[3] and v > v[4] and v > v[5] then 1 else 0;
def sigl = if !OpenRangeTime and v[1] < v[2] and v[1] < v[3] and v[1] < v[4] and v[1] < v[5] and v[1] < v[6] then 1 else 0;
def offset = -1;
plot vsigh = sigh == 1;
vsigh.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);
vsigh.SetDefaultColor(Color.YELLOW);
vsigh.SetLineWeight(3);
plot vsigl = sigl == 1;
vsigl.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);
vsigl.SetDefaultColor(Color.YELLOW);
vsigl.SetLineWeight(3);