Questions for tag "thinkscript" (12)

Votes
Answers
Views
Question
1
vote
1
answer
467
views
asked 5 years ago by
How do I add my custom indicators to the MarketWatch/StudyAlert/thinkscript editor, not seting alerts on the indicator itself. My custom indicators show up under the condition wizard but then it popes up error (rec usage is not allowed in this contex...
1
vote
2
answers
1484
views
asked 5 years ago by
Category: Stock Scanners
There is some good news, we can debug scan code by using the plot statement to let the scan engine test a condition. We see that the condition is true if the results are the full set of symbols. Example: <pre> input offset = 0; def sum = 1; plo...
1
vote
1
answer
41
views
asked 2 years ago by
Category: Chart Studies
Hi, I would like to plot 2 lines - high & low - for only the afterhours sessions (from close of real trading hours to rollover). Is that possible to do without hardcoding start and end times (whether as inputs or as static values - /Cl close to r...
0
votes
3
answers
2615
views
asked 6 years ago by
Hello, I'm trying to set up alerts in Thinkorswim when a 30 minute candle CLOSES either at or above the upper weighted bollinger band or at or below the lower weighted bollinger band. The scripts that I keep trying to use are giving me several false ...
0
votes
1
answer
79
views
asked 5 years ago by
Category: Chart Studies
I need help with some code logic. suppose x is the high and y is the low of an indicator. how do I make a variable true if "close crosses above x" and false when "close crosses below y"? The problem if I use "close crosses above x" is that it will on...
0
votes
1
answer
285
views
asked 5 years ago by
Category: Strategy Guide
I am trying to backtest a strategy of 9/20 ema crossing (buying or shorting on the crossover) and am having a little issue. My code will initiate the initial buy when I want it to but it won't sell out and rebuy when the criteria is met. Any thoughts...
0
votes
1
answer
502
views
asked 4 years ago by
Category: Strategy Guide
Hi Pete, Thanks for all the great resources.  I am new to thinkscript and have been working on a EMA cross strategy in TOS that I have pieced together from several different resources online.  Below is the entire script: input tradeSize = 100; def si...
0
votes
1
answer
181
views
asked 4 years ago by
Category: Chart Studies
Hi, thanks for the great forum and videos. Very informative! I am running an option strategy intraday and I have a stop loss on an option price to manage my risk. In order to improve my strategy and stop losses accuracy, I'd like to be able to find a...
0
votes
1
answer
133
views
asked 4 years ago by
Category: Chart Studies
Let's say I am looking at 1min chart. I can plot, let's say, SVE pivots of daily aggregation. I also want to plot the pivots with aggregationperiod.month. However, the monthly won't show up except for the 1st and 2nd day of month (As in the bar is in...
0
votes
1
answer
119
views
asked 4 years ago by
Category: Chart Studies
Hi, I am trying to create a study that plots second order pivots (definition and visualization of the study is given in the attached image). Attached is the code that I have written (could not add into description due to length of post) which does no...