Alpha Time Periods for ThinkorSwim

korygill

korygill

Active member
VIP
If you follow volume profile or TPO or the combo of the two MonkeyBars on thinkorswim, you probably notice thinkorswim does not show the time periods with alpha characters.

This study shows time periods A through M as pictured below.



Link to Flex Grid with the study (you get source code with that too)

https://tos.mx/Iq1q2RX

Source

Code:
#
#AlphaTimePeriods
#
# Author: Kory Gill, @korygill
#
#

declare upper;
declare hide_on_daily;
declare once_per_bar;

#
# You can turn off everything if you want or when you're done using it.
#
input showAlphaTimePeriods = yes; #hint showAlphaTimePeriods: if no, hides the AlphaTimePeriods study
input showTodayOnly = yes;
input timeOffsetFromEST = -300; #hint timeOffsetFromEST: 24-hour time offset from EST (-300 for PST)

DefineGlobalColor("A", CreateColor(255, 255, 0));
DefineGlobalColor("BtoEOD", CreateColor(128, 128, 0));

def aggPeriod = GetAggregationPeriod();
def isToday = GetDay() == GetLastDay();
def showPlot = if (aggPeriod <= AggregationPeriod.THIRTY_MIN) and
                  (showTodayOnly == no or isToday)
               then 1
               else 0;

def startTime = 0630 - timeOffsetFromEST;;

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 0,
    "A",
    GlobalColor("A"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 30,
    "B",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 60,
    "C",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 90,
    "D",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 120,
    "E",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 150,
    "F",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 180,
    "G",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 210,
    "H",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 240,
    "I",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 270,
    "J",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 300,
    "K",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 330,
    "L",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 360,
    "M",
    GlobalColor("BtoEOD"));

AddVerticalLine(
    showPlot and SecondsFromTime(startTime) == 60 * 390,
    "EOD",
    GlobalColor("BtoEOD"));

#
# End of script
#
 
I

Ian_Tai

New member
I have been spending some time with monkey bars and found this single post thread. Thought I would add a tweak to the monkey script and ask for a bit of help:

I wanted to reduce how much I have to handle the mouse to read price detail. So, I added the following labels to the Monkey Bar script to clearly see the POC and Value areas. Just paste at the end.

AddLabel(yes,"Monkey Bar:" + MBar, Color.Light_ORANGE);
AddLabel(yes,"PGHigh:" + hPG, Color.Light_ORANGE);
AddLabel(yes,"PGLow:" + lPG, Color.Light_ORANGE);

As for help, I would like to add an opacity input to the Volume component of Monkey bars so volume not prominent. I added an input "VolumeOpacity." But, I cannot make it functional.

Thanks. Hope the labels help someone.
 

Similar threads

Top