New version 18 available now


Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

NYSE TICK with Bands Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Partha223
Posted : Tuesday, March 13, 2018 9:14:21 PM
Registered User
Joined: 2/13/2018
Posts: 33

Hi Bruce,

Here is one of the ThinkorSwim platform code to draw the bands abround the NYSE tick charts.

Appreciate if this can be coverterd to use in our TC2000 platform.

This has got notfication as well in sound, if not possible in sound any popup kinda alert mechanism should help.

Thanks a ton in advance.

input showOnlyToday = YES;
input Market_Open_Time = 0930;
input Market_Close_Time = 1600;
input tickAveragePeriod = 20;
input bollingerBandFactor = 2.0;
def day = getDay();
def lastDay = getLastDay();
def isToday = if(day==lastDay,1,0);
def shouldPlot = if(showOnlyToday and isToday, 1,if(!showOnlyToday,1,0));
def pastOpen = if((secondsTillTime(Market_Open_Time) > 0), 0,1);
def pastClose = if((secondsTillTime(Market_Close_Time) > 0), 0,1);
def marketOpen = if(pastOpen and !pastClose, 1, 0);
def rstBar =if (day[1] != day, day-1, 0);
rec regHoursHigh = if(high > regHoursHigh[1] and marketOpen, high, if(marketOpen and !rstBar, regHoursHigh[1], high));
plot TICK_High = if(marketOpen and shouldPlot, regHoursHigh, Double.nan);
TICK_High.SetDefaultColor(color.orange);
TICK_High.SetLineWeight(1);
rec regHoursLow = if(low < regHoursLow[1] and marketOpen, low, if(marketOpen and !rstBar, regHoursLow[1],low));
plot TICK_Low = if(marketOpen and shouldPlot, regHoursLow, double.nan);
TICK_Low.SetLineWeight(1);
TICK_Low.setDefaultColor(color.red);
input HighThreshold = 1000;
input LowThreshold = -1000;
def tickDataLow = low("$TICK");
def tickDataHigh = high("$TICK");
def tickClose = close("$TICK");
def isLow = if((tickDataLow < LowThreshold), 1, 0);
def isHigh = if((tickDataHigh > HighThreshold), 1, 0);
plot ExtremeTick = if(isLow and !isHigh, low, if(isHigh and !isLow , high, double.nan));
ExtremeTick.setStyle(curve.POINTS);
ExtremeTick.setPaintingStrategy(paintingStrategy.LINE_VS_TRIANGLES);
ExtremeTick.setDefaultColor(color.yellow);
ExtremeTick.setLineWeight(3);
plot tickSMA = average(tickClose,tickAveragePeriod);
tickSMA.setLineWeight(3);
tickSMA.setDefaultColor(color.white);
def ticksDev = stdev(tickClose, tickAveragePeriod);
plot tickBBH = tickSMA+bollingerBandFactor*tickSDev;
tickBBH.setLineWeight(1);
tickBBH.setDefaultColor(color.dark_gray);
plot tickBBL = tickSMA-bollingerBandFactor*tickSDev;
tickBBL.setLineWeight(1);
tickBBL.setDefaultColor(color.dark_gray);
AssignPriceColor(if tickSMA >= 0 then color.light_gray else color.light_gray);
plot eHT = HighThreshold;
eHT.setDefaultColor(color.dark_gRAY);
plot eLT = LowThreshold;
eLT.setDefaultColor(color.dark_gRAY);
plot zero = 0;
zero.setDefaultColor(color.red);
zero.setLineWeight(2);
alert(TICK_High>TICK_High[1], "New High Tick", alert.bar, sound.ring);
alert(TICK_Low<TICK_Low[1], "New Low Tick", alert.bar, sound.ring);

 

Bruce_L
Posted : Wednesday, March 14, 2018 10:19:27 AM


Worden Trainer

Joined: 10/7/2004
Posts: 64,305

There is no way to check for the start or end of the trading in an intraday Personal Criteria Formula in TC2000.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Partha223
Posted : Wednesday, March 14, 2018 1:09:12 PM
Registered User
Joined: 2/13/2018
Posts: 33

Any clue this could be available in future versions ?

Bruce_L
Posted : Wednesday, March 14, 2018 1:10:30 PM


Worden Trainer

Joined: 10/7/2004
Posts: 64,305

Thank you for your suggestion. I do not know when or if any partiuclar suggestion might get implemented.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Partha223
Posted : Thursday, March 15, 2018 10:39:37 AM
Registered User
Joined: 2/13/2018
Posts: 33

Thanks Bruce

Bruce_L
Posted : Thursday, March 15, 2018 10:53:04 AM


Worden Trainer

Joined: 10/7/2004
Posts: 64,305

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.