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);
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
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
|
Registered User Joined: 2/13/2018 Posts: 33
|
Any clue this could be available in future versions ?
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
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
|
Registered User Joined: 2/13/2018 Posts: 33
|
Thanks Bruce
|