Tick/q Chart Alignment

solaris

Member
Is it possible to use this indicator on the same chart with the qqq or /nq, instead of using a different chart becuase i cannot get the time to synch up correctly. I've tried using the comparison symbol but that doesn't help. I would like to have a chart with the qqq or /nq and have the ability to read the $tick/q on the same chart if that is possible. any suggestions would help.
 

Attachments

  • Tickq.PNG
    Tickq.PNG
    226 KB · Views: 129
  • Ticks.txt
    1.7 KB · Views: 123
Solution
Is it possible to use this indicator on the same chart with the qqq or /nq, instead of using a different chart becuase i cannot get the time to synch up correctly. I've tried using the comparison symbol but that doesn't help. I would like to have a chart with the qqq or /nq and have the ability to read the $tick/q on the same chart if that is possible. any suggestions would help.

This has 2 scripts, both using the depricated (not supported) addchart() function. Both are placed in the lower panel. In chart settings/general, the Layout: show price subgraph is unchecked.

This will allow the use of TOS's normalization process to combine the display of both in one chart. This process using the left and righ axis will cause the...
Is it possible to use this indicator on the same chart with the qqq or /nq, instead of using a different chart becuase i cannot get the time to synch up correctly. I've tried using the comparison symbol but that doesn't help. I would like to have a chart with the qqq or /nq and have the ability to read the $tick/q on the same chart if that is possible. any suggestions would help.

This has 2 scripts, both using the depricated (not supported) addchart() function. Both are placed in the lower panel. In chart settings/general, the Layout: show price subgraph is unchecked.

This will allow the use of TOS's normalization process to combine the display of both in one chart. This process using the left and righ axis will cause the candles to move to stay within those axis settings.

The Chart is set to 1m using QQQ.

The lower study using "$TICK/Q" is set to 5m as used in your image. It is set to enable left axis.

Here is a link related to the image below. https://tos.mx/aQw5CPG
Here us the "QQQ" addchart script in the lower panel
Code:
input sym = "QQQ";
input charttype = ChartType.CANDLE;

 
    def oPart = open(symbol = sym);
    def hPart = high(symbol = sym);
    def lPart = low(symbol = sym);
    def cPart = close(symbol = sym);

    def o1 = if oPart < cPart then oPart else Double.NaN;
    def c1 = if oPart < cPart then cPart else Double.NaN;
    def h1 = if oPart < cPart then hPart else Double.NaN;
    def l1 = if oPart < cPart then lPart else Double.NaN;

    AddChart(growColor = Color.GREEN, fallColor = Color.RED, neutralColor = Color.GRAY, high = h1, low = l1, open = c1, close = o1, type = charttype);

    def o = if oPart >= cPart then oPart else Double.NaN;
    def h = hPart;
    def l = lPart;
    def c = if oPart >= cPart then cPart else Double.NaN;
    AddChart(growColor = CreateColor(153, 0, 0), fallColor = Color.GREEN, neutralColor = Color.GRAY, high = h, low = l, open = o, close = c, type = charttype);
Here is the "$TICK/Q" script in the lower panel
Code:
#provide by Tonie Hock in thinkscript lounge
input symbol = "$TICK/Q";
input AggPeriodMin = 5;

#hidePricePlot();
def ChartAggMin = getAggregationPeriod() / 1000 / 60;
def multiplier = AggPeriodMin / ChartAggMin;
def x = barNumber();
def c = close(symbol);
def o = if x % multiplier == 0
        then open(symbol)
        else o[1];
def h = if x % multiplier == 0
        then high(symbol)
        else max(high(symbol), h[1]);
def l = if x % multiplier == 0
        then low(symbol)
        else min(low(symbol), l[1]);
def c1=if x%multiplier==0 and o<=c  then c   else double.nan;
def o1=if x%multiplier==0 and o<=c  then o[1]+0 else double.nan;
def h1=if x%multiplier==0 and o<=c  then max(h+0,h[1]+0) else double.nan;
def l1=if x%multiplier==0 and o<=c  then min(l+0,l[1]+0) else double.nan;

addLabel(1, "Agg Min. = " + AggPeriodMin +
          "  Open = " + o +
          "  High = " + h +
          "  Low = " + l +
          "  Close = " + c +
          "  OHLC = " + ((o+h+l+c)/4), color.white);
addchart(h1,l1,o1,c1, type = charttype.candle,color.white);

def c2=if x%multiplier==0 and o>=c  then c   else double.nan;
def o2=if x%multiplier==0 and o>=c  then o[1]+0 else double.nan;
def h2=if x%multiplier==0 and o>=c  then max(h+0,h[1]+0) else double.nan;
def l2=if x%multiplier==0 and o>=c  then min(l+0,l[1]+0) else double.nan;


addchart(h2,l2,o2,c2, type = charttype.candle,color.cyan);

plot zerobase = 0;
 
Solution

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

This has 2 scripts, both using the depricated (not supported) addchart() function. Both are placed in the lower panel. In chart settings/general, the Layout: show price subgraph is unchecked.

This will allow the use of TOS's normalization process to combine the display of both in one chart. This process using the left and righ axis will cause the candles to move to stay within those axis settings.

The Chart is set to 1m using QQQ.

The lower study using "$TICK/Q" is set to 5m as used in your image. It is set to enable left axis.

Here is a link related to the image below. https://tos.mx/aQw5CPG

Here us the "QQQ" addchart script in the lower panel

Here is the "$TICK/Q" script in the lower panel
Thank for the help, this is good to know
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
450 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