• Memorial Day Sale! Claim the biggest discount of the year with $50 off VIP using code MEM50. Sign up here.


  1. C

    Creating an alert for custom study?

    Hi, can anyone help me with creating an alert for a custom study? Id highly appreciate it! Thank you!
  2. mechanik

    is this an iteration or function?

    The thinkorswim docs don't give much about the sum function.. but in this code is the variable 'QQQtmp1' being iterated by the SUM function over the length of bars like a function? def QQQprice = close(symbol="QQQ"); def QQQVolume = volume(symbol="QQQ"); def length = 21 def QQQtmp1 = if...
  3. L

    Moving average of VWAP?

    Hi... trying to understand exactly what just one line here is doing.... Is it plotting the moving average of VWAP? The question is repeated in the code as comments. ## Start Code input vwap_price = FundamentalType.VWAP; input vwap_aggregationPeriod = AggregationPeriod.FOUR_HOURS...
  4. P

    alert or when SPY price/close goes below 200 SMA?

    how about an alert or when SPY price/close goes below 200 SMA?
  5. C

    150 SMA Scan Help

    Hey there...I'm attempting to capture the crest of 150 SMA's as stocks move from Stage 2 into Stage 3. I would post some photos but imgur isn't loading today for some reason... Let's use PTON as the first example...there's a huge stage 2 runup but in late April/early May of 2021, the 150 SMA...
  6. D

    Is there any Indicator can warm me when those situations appearance?

    Hello, Guys. I knew there are many Indicators can show you when price break out PrevHigh,but I just want to know if there is a Indicator can combine those situations? 1.Pre-makret not show a big volume(can be Pre-volume <10days pre-volume avg ) 2.When price break out PrevHigh,price pull back...
  7. R

    Watchlist in TOS

  8. M

    Force trailing zero to display after decimal in a label

    Is there a way to force a 2 digit decimal label to always display two digits, rather than rounding ? For example I want to show .20 rather than .2 to maintain alignment.
  9. D

    Limit trade re-entry

    I'm trying to figure out a way to limit re-entry after a target is hit in a strategy. For instance I BUY_TO_OPEN and then SELL once the position has moved in my favor by one ATR. But the BUY conditions are often still valid after that so another position is entered on the next bar. I want to...
  10. C

    Advanced Options Strategy - ToS Strangle - Conditional Orders: Help on referencing strike price

    Looking for help on something that seems relatively simple. I have limited experience using thinkscript, but am very familiar with conditional orders in ThinkorSwim. I am attempting to set up different intervals that are used in either OCO or 1st Trgs Seq order types depending on the situation...
  11. Q

    Need help for CODE. define the "MarketOpen" time to extend Hours. 16:00--17:00 and 18:00--09:30

    Please, I'd like to test how the indicator performance on the Tick chart is just in extended hours. Could someone help me to modify the code below. I want to define the "MarketOpen" time to just extend Hours. 16:00--17:00 and 18:00--09:30 Thanks. nput tradeDaytimeOnly = yes; #hint...
  12. G

    Combine multiple time frame studies to single chart.

    Trying to see if it's possible to have the support and resistance study I use on higher time frame chart overlap on the lower time frame chart, showing supp. and resist. from higher time frame. I'm using a single laptop screen trying to save screen space. Sorry if this has been asked/answered or...
  13. L

    Market internal overlay

    I am wondering if it is possible to plot an overly of all the market internals on one window. For example, $AD-NYSE, $TRIN-NYSE, inverse of $VIX, etc. I tend to like smooth them a little bit by 10 bar SMA or EMA, AND THEN plot the smoothed data on chart. I prefer to plot this as an upper...
  14. B

    Scan for Beta in TOS

    Does anyone have a script for a scan in TOS for an instrument's Beta?
  15. L

    ">" and "="

    Here is a code : case long: if (price > trail[1]) { state = state.long; trail = Max(trail[1], malow); } else { state = state.short; trail = mahigh; I wanna state price>=trail[1], but if i add "=" after ">", it gives me error msg, so may i know how to do it
  16. a1cturner

    Color Bars when Buy Signal UNTIL Sell Signal

    I have over 300 lines of code written but I can’t figure this one problem out. I have several criteria that must all align to create a buy signal. I have that defined properly right now. The next step I would like is to color the bars (green for long) or (red for short) until I get a defined...
  17. M

    Need help add Dot and Bubble at the end of Trend line

  18. R

    Want ThinkScript code to get the value of a purchase made today

    I know how to enter "one triggers sequence" orders. How can I get the value of a purchase made today in order to use it as part of a sell script? For example, the sell script might be like this (if I can get code for the PurchasePrice) # intention is to sell for 1% gain def PurchasePrice = x...
  19. N

    Scanner for stocks showing Tight CPR in daily and weekly timeframes

    Hi, I am looking to create a scanner to determine the stocks which will have a Tight CPR and hence possibility of stronger momentum for moving up/down the next day. Also, I am looking for a similar scanner that could give the same outcome but in a weekly timeframe. I have gone through the...
  20. T

    Daily candle relative to daily 21 EMA label on smaller timeframes?

    Hi, all! I'm new to ThinkScript and would love some direction. I'd like a label at the top of intraday charts that shows which side of the daily 21EMA that price action is occurring: above, below, or neutral Has anyone written anything similar I can start from?