Verniman trading style

STB

Member
Its finally coming together, I have been following this guy for years.
Prior post: https://usethinkscript.com/threads/...s-futures-entry-signals-for-thinkorswim.2365/

If you want to learn vol profile check this guy out, he is the best I have seen.
Below I use his vol profile setup with prior days sup/res lines along with bookmap to watch foot print and heatmap. I also have tickstrike to alert on big volume moves.
yjGY7Ws.png
 
Its finally coming together, I have been following this guy for years.
Prior post: https://usethinkscript.com/threads/...s-futures-entry-signals-for-thinkorswim.2365/

If you want to learn vol profile check this guy out, he is the best I have seen.
Below I use his vol profile setup with prior days sup/res lines along with bookmap to watch foot print and heatmap. I also have tickstrike to alert on big volume moves.
yjGY7Ws.png
Can you share a link for your chart set-up? Big fan of volume profile and working on learning Bookmap. Thanks in advance!
 
Its finally coming together, I have been following this guy for years.
Prior post: https://usethinkscript.com/threads/...s-futures-entry-signals-for-thinkorswim.2365/

If you want to learn vol profile check this guy out, he is the best I have seen.
Below I use his vol profile setup with prior days sup/res lines along with bookmap to watch foot print and heatmap. I also have tickstrike to alert on big volume moves.
yjGY7Ws.png
Nice man, I got mine to about 1 bar off of his entries/exits. Although it was way dif than what he would suggest.
 
Like most of you I have followed Verniman's posts. While most posts are now deleted while he worked on his approach. I took notes of what he said. Regardless of what he states. Past posts (now deleted) indicated Tick, BSP, Demand Index, Volume, SPX Cash Internals, SPX Ratio(s), and levels are all mentioned. For example, BSP has been described as "an original TOS code that is locked", SPX Cash Internals/ratio(s), Volume, Demand Index. Additionally, if you remember his 3 ratios on the right chart. It was the middle number that he used as an example of BSP..... So happy hunting!
Time permitting and with STB's code. I have been playing with certain parameters. For me, RSI was the closest that I could get to his actual trades. Some of his earlier posts had STO at the bottom so that is a real possibility as well. Lately this setup has been as accurate.
I hope this helps in some capacity.

http://tos.mx/8kUpqO3
Code:
#Trade ideas from Verniman
#Original Logic from STB Usethinkscript 7/20
#Trade above below vwap
#Past posts (now deleted) indicated BSP, Demand Index, STO, Volume, SPX Cash Internals, and levels
#Most trades are breakout based above below VWAP
#RSI has given the best mirror for trades from 2020-22

###### TIME ######

input zoneStartAM = 930;
input zoneEndAM = 1200;
input zoneStartPM = 1330;
input zoneEndPM = 1600;
input zoneEndclose = 1609;
input type = {default NOTRADE, REVERSAL};
input price = close;
input length = 5;
input over_bought = 70;
input over_sold = 30;
input rsiAverageType = AverageType.SIMPLE;
input MALength = 2;

def rsi = reference RSI(price = price, length = length, averageType = rsiAverageType);
def RSIMA = Average(rsi, MALength);

#AddOrder(OrderType.BUY_AUTO, rsi crosses above over_sold, tickColor = GetColor(0), arrowColor = #GetColor(0), name = "RSI_LE");
#AddOrder(OrderType.SELL_AUTO, rsi crosses below over_bought, tickColor = GetColor(1), arrowColor = #GetColor(1), name = "RSI_SE");
def highBar;
def lowBar;
def highBar2;
def lowBar2;

switch (type){
case NOTRADE:
    highBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then HighestAll(open) else Double.NaN;
    lowBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then LowestAll(close) else Double.NaN;
case REVERSAL:
    lowBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then HighestAll(open) else Double.NaN;
    highBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then LowestAll(close) else Double.NaN;
}

switch (type){
case NOTRADE:
    highBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then HighestAll(open) else Double.NaN;
    lowBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then LowestAll(close) else Double.NaN;
case REVERSAL:
    lowBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then HighestAll(open) else Double.NaN;
    highBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then LowestAll(close) else Double.NaN;
}



###### TIME END #####

def adspdl = low("$adspd");
def adspdh = high("$adspd");
def adspdc = close("$adspd");
def volspd = close("$volspd");

def HMA = MovingAverage(AverageType.HULL, close, 21);

input numDevDn = -2.0;
input numDevUp = 2.0;
input timeFrame = {default DAY, WEEK, MONTH};

def cap = GetAggregationPeriod();
def errorInAggregation =
    timeFrame == timeFrame.DAY and cap >= AggregationPeriod.WEEK or
    timeFrame == timeFrame.WEEK and cap >= AggregationPeriod.MONTH;
Assert(!errorInAggregation, "timeFrame should be not less than current chart aggregation period");

def yyyyMmDd = GetYYYYMMDD();
def periodIndx;
switch (timeFrame) {
case DAY:
    periodIndx = yyyyMmDd;
case WEEK:
    periodIndx = Floor((DaysFromDate(First(yyyyMmDd)) + GetDayOfWeek(First(yyyyMmDd))) / 7);
case MONTH:
    periodIndx = RoundDown(yyyyMmDd / 100, 0);
}
def isPeriodRolled = CompoundValue(1, periodIndx != periodIndx[1], yes);

def volumeSum;
def volumeVwapSum;
def volumeVwap2Sum;

if (isPeriodRolled) {
    volumeSum = volume;
    volumeVwapSum = volume * vwap;
    volumeVwap2Sum = volume * Sqr(vwap);
} else {
    volumeSum = CompoundValue(1, volumeSum[1] + volume, volume);
    volumeVwapSum = CompoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap);
    volumeVwap2Sum = CompoundValue(1, volumeVwap2Sum[1] + volume * Sqr(vwap), volume * Sqr(vwap));
}
def price1 = volumeVwapSum / volumeSum;
def deviation = Sqrt(Max(volumeVwap2Sum / volumeSum - Sqr(price1), 0));

def VWAP = price1;



#AssignPriceColor(if adspdl < adspdl[1] && close < vwap && close< hma && volume > volume[1] then #Color.RED else if adspdh > adspdh[1] && close > vwap && close > hma && volume>volume[1] then #Color.GREEN else Color.GRAY);


####LONGS####

AddOrder(OrderType.BUY_TO_OPEN, SecondsTillTime(zoneStartAM) <= 0 && SecondsTillTime(zoneEndAM) >= 0 and open > VWAP && VWAP > VWAP[1] && RSIMA crosses above over_bought, name = "Buy open AM @" + open[-1], 1, Color.ORANGE, Color.GREEN);

AddOrder(OrderType.BUY_TO_OPEN,secondsTillTime(zoneStartpM) <= 0 && secondsTillTime(zoneEndpM) >= 0 and open > vwap && vwap>vwap[1] && RSIMA crosses above over_bought,  name = "Buy open AM @"+open[-1], 1, Color.ORANGE, Color.green);



##SHORTS###
#Changed close to open>vwap
AddOrder(OrderType.SELL_TO_OPEN, SecondsTillTime(zoneStartAM) <= 0 && SecondsTillTime(zoneEndAM) >= 0 and open < VWAP && VWAP < VWAP[1] && RSIMA  crosses below over_sold, name = "Sell open AM @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.SELL_TO_OPEN, SecondsTillTime(zoneStartPM) <= 0 && SecondsTillTime(zoneEndPM) >= 0 and  open < VWAP && VWAP < VWAP[1] && RSIMA crosses below over_sold, name = "Sell open PM @" + open[-1], 1, Color.ORANGE, Color.RED);

####Close orders######

AddOrder(OrderType.SELL_TO_CLOSE, RSIMA  crosses below over_bought, name = "Sell close @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.BUY_TO_CLOSE, RSIMA  crosses above over_sold, name = "Buy close @" + open[-1], 1, Color.ORANGE, Color.RED);

###Market close orders####

AddOrder(OrderType.BUY_TO_CLOSE, SecondsTillTime(zoneEndclose) <= 0, name = "Buy Market Close @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.SELL_TO_CLOSE, SecondsTillTime(zoneEndclose) <= 0, name = "Sell Market Close @" + open[-1], 1, Color.ORANGE, Color.RED);
 
Last edited:
Like most go you I have followed Verniman's posts. While most posts are now deleted while he worked on his approach. I took notes of what he said. Regardless of what he states. Past posts (now deleted) indicated Tick, BSP, Demand Index, Volume, SPX Cash Internals, SPX Ratio(s), and levels are all mentioned. For example, BSP has been described as "an original TOS code that is locked", SPX Cash Internals/ratio(s), Volume, Demand Index. Additionally, if you remember his 3 ratios on the right chart. It was the middle number that he used as an example of BSP..... So happy hunting!
Time permitting and with STB's code. I have been playing with certain parameters. For me, RSI was the closest that I could get to his actual trades. Some of his earlier posts had STO at the bottom so that is a real possibility as well. Lately this setup has been as accurate.
I hope this helps in some capacity.

http://tos.mx/8kUpqO3
Code:
#Trade ideas from Verniman
#Original Logic from STB Usethinkscript 7/20
#Trade above below vwap
#Past posts (now deleted) indicated BSP, Demand Index, STO, Volume, SPX Cash Internals, and levels
#Most trades are breakout based above below VWAP
#RSI has given the best mirror for trades from 2020-22

###### TIME ######

input zoneStartAM = 930;
input zoneEndAM = 1200;
input zoneStartPM = 1330;
input zoneEndPM = 1600;
input zoneEndclose = 1609;
input type = {default NOTRADE, REVERSAL};
input price = close;
input length = 5;
input over_bought = 70;
input over_sold = 30;
input rsiAverageType = AverageType.SIMPLE;
input MALength = 2;

def rsi = reference RSI(price = price, length = length, averageType = rsiAverageType);
def RSIMA = Average(rsi, MALength);

#AddOrder(OrderType.BUY_AUTO, rsi crosses above over_sold, tickColor = GetColor(0), arrowColor = #GetColor(0), name = "RSI_LE");
#AddOrder(OrderType.SELL_AUTO, rsi crosses below over_bought, tickColor = GetColor(1), arrowColor = #GetColor(1), name = "RSI_SE");
def highBar;
def lowBar;
def highBar2;
def lowBar2;

switch (type){
case NOTRADE:
    highBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then HighestAll(open) else Double.NaN;
    lowBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then LowestAll(close) else Double.NaN;
case REVERSAL:
    lowBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then HighestAll(open) else Double.NaN;
    highBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then LowestAll(close) else Double.NaN;
}

switch (type){
case NOTRADE:
    highBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then HighestAll(open) else Double.NaN;
    lowBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then LowestAll(close) else Double.NaN;
case REVERSAL:
    lowBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then HighestAll(open) else Double.NaN;
    highBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then LowestAll(close) else Double.NaN;
}



###### TIME END #####

def adspdl = low("$adspd");
def adspdh = high("$adspd");
def adspdc = close("$adspd");
def volspd = close("$volspd");

def HMA = MovingAverage(AverageType.HULL, close, 21);

input numDevDn = -2.0;
input numDevUp = 2.0;
input timeFrame = {default DAY, WEEK, MONTH};

def cap = GetAggregationPeriod();
def errorInAggregation =
    timeFrame == timeFrame.DAY and cap >= AggregationPeriod.WEEK or
    timeFrame == timeFrame.WEEK and cap >= AggregationPeriod.MONTH;
Assert(!errorInAggregation, "timeFrame should be not less than current chart aggregation period");

def yyyyMmDd = GetYYYYMMDD();
def periodIndx;
switch (timeFrame) {
case DAY:
    periodIndx = yyyyMmDd;
case WEEK:
    periodIndx = Floor((DaysFromDate(First(yyyyMmDd)) + GetDayOfWeek(First(yyyyMmDd))) / 7);
case MONTH:
    periodIndx = RoundDown(yyyyMmDd / 100, 0);
}
def isPeriodRolled = CompoundValue(1, periodIndx != periodIndx[1], yes);

def volumeSum;
def volumeVwapSum;
def volumeVwap2Sum;

if (isPeriodRolled) {
    volumeSum = volume;
    volumeVwapSum = volume * vwap;
    volumeVwap2Sum = volume * Sqr(vwap);
} else {
    volumeSum = CompoundValue(1, volumeSum[1] + volume, volume);
    volumeVwapSum = CompoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap);
    volumeVwap2Sum = CompoundValue(1, volumeVwap2Sum[1] + volume * Sqr(vwap), volume * Sqr(vwap));
}
def price1 = volumeVwapSum / volumeSum;
def deviation = Sqrt(Max(volumeVwap2Sum / volumeSum - Sqr(price1), 0));

def VWAP = price1;



#AssignPriceColor(if adspdl < adspdl[1] && close < vwap && close< hma && volume > volume[1] then #Color.RED else if adspdh > adspdh[1] && close > vwap && close > hma && volume>volume[1] then #Color.GREEN else Color.GRAY);


####LONGS####

AddOrder(OrderType.BUY_TO_OPEN, SecondsTillTime(zoneStartAM) <= 0 && SecondsTillTime(zoneEndAM) >= 0 and open > VWAP && VWAP > VWAP[1] && RSIMA crosses above over_bought, name = "Buy open AM @" + open[-1], 1, Color.ORANGE, Color.GREEN);

AddOrder(OrderType.BUY_TO_OPEN,secondsTillTime(zoneStartpM) <= 0 && secondsTillTime(zoneEndpM) >= 0 and open > vwap && vwap>vwap[1] && RSIMA crosses above over_bought,  name = "Buy open AM @"+open[-1], 1, Color.ORANGE, Color.green);



##SHORTS###
#Changed close to open>vwap
AddOrder(OrderType.SELL_TO_OPEN, SecondsTillTime(zoneStartAM) <= 0 && SecondsTillTime(zoneEndAM) >= 0 and open < VWAP && VWAP < VWAP[1] && RSIMA  crosses below over_sold, name = "Sell open AM @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.SELL_TO_OPEN, SecondsTillTime(zoneStartPM) <= 0 && SecondsTillTime(zoneEndPM) >= 0 and  open < VWAP && VWAP < VWAP[1] && RSIMA crosses below over_sold, name = "Sell open PM @" + open[-1], 1, Color.ORANGE, Color.RED);

####Close orders######

AddOrder(OrderType.SELL_TO_CLOSE, RSIMA  crosses below over_bought, name = "Sell close @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.BUY_TO_CLOSE, RSIMA  crosses above over_sold, name = "Buy close @" + open[-1], 1, Color.ORANGE, Color.RED);

###Market close orders####

AddOrder(OrderType.BUY_TO_CLOSE, SecondsTillTime(zoneEndclose) <= 0, name = "Buy Market Close @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.SELL_TO_CLOSE, SecondsTillTime(zoneEndclose) <= 0, name = "Sell Market Close @" + open[-1], 1, Color.ORANGE, Color.RED);
Thank you to @MHCain for this contribution
The theory behind this strategy is well-thought-out.

HOWEVER, this code uses HighestAll() functions
HXExM8a.png

https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Tech-Analysis/HighestAll

HighestAll() calculations are arbitrarily based on how many bars are on your CHART.
So everyone's results will be different depending on how many days, a member specifies in the aggregation settings.

The bigger issue when writing code with HighestAll() functions is that Schwab no longer updates these calculations in real-time.
This limits the applicability of this script as currently coded.
HighestAll() and all the other Range "All" functions are resource-intensive as they read all the bars on a chart.
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Tech-Analysis/HighestAll
ToS is currently throttling their use. They do not update in real time, which will cause your calculations and signals to lag.
https://usethinkscript.com/threads/...-range-lagging-issues-due-to-tos-update.8794/
 
Last edited:
Like most of you I have followed Verniman's posts. While most posts are now deleted while he worked on his approach. I took notes of what he said. Regardless of what he states. Past posts (now deleted) indicated Tick, BSP, Demand Index, Volume, SPX Cash Internals, SPX Ratio(s), and levels are all mentioned. For example, BSP has been described as "an original TOS code that is locked", SPX Cash Internals/ratio(s), Volume, Demand Index. Additionally, if you remember his 3 ratios on the right chart. It was the middle number that he used as an example of BSP..... So happy hunting!
Time permitting and with STB's code. I have been playing with certain parameters. For me, RSI was the closest that I could get to his actual trades. Some of his earlier posts had STO at the bottom so that is a real possibility as well. Lately this setup has been as accurate.
I hope this helps in some capacity.

http://tos.mx/8kUpqO3
Code:
#Trade ideas from Verniman
#Original Logic from STB Usethinkscript 7/20
#Trade above below vwap
#Past posts (now deleted) indicated BSP, Demand Index, STO, Volume, SPX Cash Internals, and levels
#Most trades are breakout based above below VWAP
#RSI has given the best mirror for trades from 2020-22

###### TIME ######

input zoneStartAM = 930;
input zoneEndAM = 1200;
input zoneStartPM = 1330;
input zoneEndPM = 1600;
input zoneEndclose = 1609;
input type = {default NOTRADE, REVERSAL};
input price = close;
input length = 5;
input over_bought = 70;
input over_sold = 30;
input rsiAverageType = AverageType.SIMPLE;
input MALength = 2;

def rsi = reference RSI(price = price, length = length, averageType = rsiAverageType);
def RSIMA = Average(rsi, MALength);

#AddOrder(OrderType.BUY_AUTO, rsi crosses above over_sold, tickColor = GetColor(0), arrowColor = #GetColor(0), name = "RSI_LE");
#AddOrder(OrderType.SELL_AUTO, rsi crosses below over_bought, tickColor = GetColor(1), arrowColor = #GetColor(1), name = "RSI_SE");
def highBar;
def lowBar;
def highBar2;
def lowBar2;

switch (type){
case NOTRADE:
    highBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then HighestAll(open) else Double.NaN;
    lowBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then LowestAll(close) else Double.NaN;
case REVERSAL:
    lowBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then HighestAll(open) else Double.NaN;
    highBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then LowestAll(close) else Double.NaN;
}

switch (type){
case NOTRADE:
    highBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then HighestAll(open) else Double.NaN;
    lowBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then LowestAll(close) else Double.NaN;
case REVERSAL:
    lowBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then HighestAll(open) else Double.NaN;
    highBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then LowestAll(close) else Double.NaN;
}



###### TIME END #####

def adspdl = low("$adspd");
def adspdh = high("$adspd");
def adspdc = close("$adspd");
def volspd = close("$volspd");

def HMA = MovingAverage(AverageType.HULL, close, 21);

input numDevDn = -2.0;
input numDevUp = 2.0;
input timeFrame = {default DAY, WEEK, MONTH};

def cap = GetAggregationPeriod();
def errorInAggregation =
    timeFrame == timeFrame.DAY and cap >= AggregationPeriod.WEEK or
    timeFrame == timeFrame.WEEK and cap >= AggregationPeriod.MONTH;
Assert(!errorInAggregation, "timeFrame should be not less than current chart aggregation period");

def yyyyMmDd = GetYYYYMMDD();
def periodIndx;
switch (timeFrame) {
case DAY:
    periodIndx = yyyyMmDd;
case WEEK:
    periodIndx = Floor((DaysFromDate(First(yyyyMmDd)) + GetDayOfWeek(First(yyyyMmDd))) / 7);
case MONTH:
    periodIndx = RoundDown(yyyyMmDd / 100, 0);
}
def isPeriodRolled = CompoundValue(1, periodIndx != periodIndx[1], yes);

def volumeSum;
def volumeVwapSum;
def volumeVwap2Sum;

if (isPeriodRolled) {
    volumeSum = volume;
    volumeVwapSum = volume * vwap;
    volumeVwap2Sum = volume * Sqr(vwap);
} else {
    volumeSum = CompoundValue(1, volumeSum[1] + volume, volume);
    volumeVwapSum = CompoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap);
    volumeVwap2Sum = CompoundValue(1, volumeVwap2Sum[1] + volume * Sqr(vwap), volume * Sqr(vwap));
}
def price1 = volumeVwapSum / volumeSum;
def deviation = Sqrt(Max(volumeVwap2Sum / volumeSum - Sqr(price1), 0));

def VWAP = price1;



#AssignPriceColor(if adspdl < adspdl[1] && close < vwap && close< hma && volume > volume[1] then #Color.RED else if adspdh > adspdh[1] && close > vwap && close > hma && volume>volume[1] then #Color.GREEN else Color.GRAY);


####LONGS####

AddOrder(OrderType.BUY_TO_OPEN, SecondsTillTime(zoneStartAM) <= 0 && SecondsTillTime(zoneEndAM) >= 0 and open > VWAP && VWAP > VWAP[1] && RSIMA crosses above over_bought, name = "Buy open AM @" + open[-1], 1, Color.ORANGE, Color.GREEN);

AddOrder(OrderType.BUY_TO_OPEN,secondsTillTime(zoneStartpM) <= 0 && secondsTillTime(zoneEndpM) >= 0 and open > vwap && vwap>vwap[1] && RSIMA crosses above over_bought,  name = "Buy open AM @"+open[-1], 1, Color.ORANGE, Color.green);



##SHORTS###
#Changed close to open>vwap
AddOrder(OrderType.SELL_TO_OPEN, SecondsTillTime(zoneStartAM) <= 0 && SecondsTillTime(zoneEndAM) >= 0 and open < VWAP && VWAP < VWAP[1] && RSIMA  crosses below over_sold, name = "Sell open AM @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.SELL_TO_OPEN, SecondsTillTime(zoneStartPM) <= 0 && SecondsTillTime(zoneEndPM) >= 0 and  open < VWAP && VWAP < VWAP[1] && RSIMA crosses below over_sold, name = "Sell open PM @" + open[-1], 1, Color.ORANGE, Color.RED);

####Close orders######

AddOrder(OrderType.SELL_TO_CLOSE, RSIMA  crosses below over_bought, name = "Sell close @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.BUY_TO_CLOSE, RSIMA  crosses above over_sold, name = "Buy close @" + open[-1], 1, Color.ORANGE, Color.RED);

###Market close orders####

AddOrder(OrderType.BUY_TO_CLOSE, SecondsTillTime(zoneEndclose) <= 0, name = "Buy Market Close @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.SELL_TO_CLOSE, SecondsTillTime(zoneEndclose) <= 0, name = "Sell Market Close @" + open[-1], 1, Color.ORANGE, Color.RED);
Thank you for sharing. As mentioned with @MerryDay, we should fix the HighestAll and LowestAll there. Is the intention the find the highest and lowest between the specified time duration?

Also, I'm seeing AM trades in the PM session. Is this intentional?

J7rAA7I.png
 
Like most of you I have followed Verniman's posts. While most posts are now deleted while he worked on his approach. I took notes of what he said. Regardless of what he states. Past posts (now deleted) indicated Tick, BSP, Demand Index, Volume, SPX Cash Internals, SPX Ratio(s), and levels are all mentioned. For example, BSP has been described as "an original TOS code that is locked", SPX Cash Internals/ratio(s), Volume, Demand Index. Additionally, if you remember his 3 ratios on the right chart. It was the middle number that he used as an example of BSP..... So happy hunting!
Time permitting and with STB's code. I have been playing with certain parameters. For me, RSI was the closest that I could get to his actual trades. Some of his earlier posts had STO at the bottom so that is a real possibility as well. Lately this setup has been as accurate.
I hope this helps in some capacity.

http://tos.mx/8kUpqO3
Code:
#Trade ideas from Verniman
#Original Logic from STB Usethinkscript 7/20
#Trade above below vwap
#Past posts (now deleted) indicated BSP, Demand Index, STO, Volume, SPX Cash Internals, and levels
#Most trades are breakout based above below VWAP
#RSI has given the best mirror for trades from 2020-22

###### TIME ######

input zoneStartAM = 930;
input zoneEndAM = 1200;
input zoneStartPM = 1330;
input zoneEndPM = 1600;
input zoneEndclose = 1609;
input type = {default NOTRADE, REVERSAL};
input price = close;
input length = 5;
input over_bought = 70;
input over_sold = 30;
input rsiAverageType = AverageType.SIMPLE;
input MALength = 2;

def rsi = reference RSI(price = price, length = length, averageType = rsiAverageType);
def RSIMA = Average(rsi, MALength);

#AddOrder(OrderType.BUY_AUTO, rsi crosses above over_sold, tickColor = GetColor(0), arrowColor = #GetColor(0), name = "RSI_LE");
#AddOrder(OrderType.SELL_AUTO, rsi crosses below over_bought, tickColor = GetColor(1), arrowColor = #GetColor(1), name = "RSI_SE");
def highBar;
def lowBar;
def highBar2;
def lowBar2;

switch (type){
case NOTRADE:
    highBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then HighestAll(open) else Double.NaN;
    lowBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then LowestAll(close) else Double.NaN;
case REVERSAL:
    lowBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then HighestAll(open) else Double.NaN;
    highBar = if SecondsTillTime(zoneStartAM) <= 0 and SecondsTillTime(zoneEndAM) >= 0 then LowestAll(close) else Double.NaN;
}

switch (type){
case NOTRADE:
    highBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then HighestAll(open) else Double.NaN;
    lowBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then LowestAll(close) else Double.NaN;
case REVERSAL:
    lowBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then HighestAll(open) else Double.NaN;
    highBar2 = if SecondsTillTime(zoneStartPM) <= 0 and SecondsTillTime(zoneEndPM) >= 0 then LowestAll(close) else Double.NaN;
}



###### TIME END #####

def adspdl = low("$adspd");
def adspdh = high("$adspd");
def adspdc = close("$adspd");
def volspd = close("$volspd");

def HMA = MovingAverage(AverageType.HULL, close, 21);

input numDevDn = -2.0;
input numDevUp = 2.0;
input timeFrame = {default DAY, WEEK, MONTH};

def cap = GetAggregationPeriod();
def errorInAggregation =
    timeFrame == timeFrame.DAY and cap >= AggregationPeriod.WEEK or
    timeFrame == timeFrame.WEEK and cap >= AggregationPeriod.MONTH;
Assert(!errorInAggregation, "timeFrame should be not less than current chart aggregation period");

def yyyyMmDd = GetYYYYMMDD();
def periodIndx;
switch (timeFrame) {
case DAY:
    periodIndx = yyyyMmDd;
case WEEK:
    periodIndx = Floor((DaysFromDate(First(yyyyMmDd)) + GetDayOfWeek(First(yyyyMmDd))) / 7);
case MONTH:
    periodIndx = RoundDown(yyyyMmDd / 100, 0);
}
def isPeriodRolled = CompoundValue(1, periodIndx != periodIndx[1], yes);

def volumeSum;
def volumeVwapSum;
def volumeVwap2Sum;

if (isPeriodRolled) {
    volumeSum = volume;
    volumeVwapSum = volume * vwap;
    volumeVwap2Sum = volume * Sqr(vwap);
} else {
    volumeSum = CompoundValue(1, volumeSum[1] + volume, volume);
    volumeVwapSum = CompoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap);
    volumeVwap2Sum = CompoundValue(1, volumeVwap2Sum[1] + volume * Sqr(vwap), volume * Sqr(vwap));
}
def price1 = volumeVwapSum / volumeSum;
def deviation = Sqrt(Max(volumeVwap2Sum / volumeSum - Sqr(price1), 0));

def VWAP = price1;



#AssignPriceColor(if adspdl < adspdl[1] && close < vwap && close< hma && volume > volume[1] then #Color.RED else if adspdh > adspdh[1] && close > vwap && close > hma && volume>volume[1] then #Color.GREEN else Color.GRAY);


####LONGS####

AddOrder(OrderType.BUY_TO_OPEN, SecondsTillTime(zoneStartAM) <= 0 && SecondsTillTime(zoneEndAM) >= 0 and open > VWAP && VWAP > VWAP[1] && RSIMA crosses above over_bought, name = "Buy open AM @" + open[-1], 1, Color.ORANGE, Color.GREEN);

AddOrder(OrderType.BUY_TO_OPEN,secondsTillTime(zoneStartpM) <= 0 && secondsTillTime(zoneEndpM) >= 0 and open > vwap && vwap>vwap[1] && RSIMA crosses above over_bought,  name = "Buy open AM @"+open[-1], 1, Color.ORANGE, Color.green);



##SHORTS###
#Changed close to open>vwap
AddOrder(OrderType.SELL_TO_OPEN, SecondsTillTime(zoneStartAM) <= 0 && SecondsTillTime(zoneEndAM) >= 0 and open < VWAP && VWAP < VWAP[1] && RSIMA  crosses below over_sold, name = "Sell open AM @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.SELL_TO_OPEN, SecondsTillTime(zoneStartPM) <= 0 && SecondsTillTime(zoneEndPM) >= 0 and  open < VWAP && VWAP < VWAP[1] && RSIMA crosses below over_sold, name = "Sell open PM @" + open[-1], 1, Color.ORANGE, Color.RED);

####Close orders######

AddOrder(OrderType.SELL_TO_CLOSE, RSIMA  crosses below over_bought, name = "Sell close @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.BUY_TO_CLOSE, RSIMA  crosses above over_sold, name = "Buy close @" + open[-1], 1, Color.ORANGE, Color.RED);

###Market close orders####

AddOrder(OrderType.BUY_TO_CLOSE, SecondsTillTime(zoneEndclose) <= 0, name = "Buy Market Close @" + open[-1], 1, Color.ORANGE, Color.RED);

AddOrder(OrderType.SELL_TO_CLOSE, SecondsTillTime(zoneEndclose) <= 0, name = "Sell Market Close @" + open[-1], 1, Color.ORANGE, Color.RED);
What time frame is this meant to be used on?
 
Thank you for sharing. As mentioned with @MerryDay, we should fix the HighestAll and LowestAll there. Is the intention the find the highest and lowest between the specified time duration?

Also, I'm seeing AM trades in the PM session. Is this intentional?

J7rAA7I.png
HighestAll - Sorry I copy, paste, and assemble all of my codes. You would have to ask an “actual” coder.

PM Trades - I only glanced at the code. I believe the verbiage wasn’t changed when I copied it. So a verbiage change should fox it.

Hope these help.
 
What time frame is this meant to be used on?
HighestAll - Sorry I copy, paste, and assemble all of my codes. You would have to ask an “actual” coder.

PM Trades - I only glanced at the code. I believe the verbiage wasn’t changed when I copied it. So a verbiage change should fox it.

Hope these
What time frame is this meant to be used on?
3 minute….. He post his trades on 3min. But he has often talked about “higher” timeframes and tick charts from 500t-1600t. So happy hunting.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
369 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top