EasyRantisi
New member
Is there a way to make this into a bot? auto trades using the script in this indicator with TDA API system? Also Does this website have such codes that people share here? Thanks
VTR is a momentum indicator that shows if a stock is overbought or oversold based on its Weekly and Monthly average volatility trading range.
For sure. In my experience the times the reversals actually work on the 1 minute are more times than the repaints. So getting stopped out 2 times trying to find a true reversal is small compared to the 30 cent plus move. Has that been your experience? What indicator has benefited you the most? For me it’s probably the volume buy sell. Helpful when reading price action.@EasyRantisi Welcome to the usethinkscript forums... While you may be initially impressed by this indicator, hopeflly you have read about it repainting and understand the risks... I wouldn't consider this indicator to be worthy of any form of auto-trading even if it was supported by Thinkorswim...There are only a couple of auto-trading adaptations mentioned here in these forums that use an API and Python... Use the site search feature to locate them... Most members who semi-automate their trades do so using Conditional Orders with custom Thinkscript embedded in them... You will also find that a vast majority of members here primarily scalp or day trade... Good luck...
For sure. In my experience the times the reversals actually work on the 1 minute are more times than the repaints. So getting stopped out 2 times trying to find a true reversal is small compared to the 30 cent plus move. Has that been your experience? What indicator has benefited you the most? For me it’s probably the volume buy sell. Helpful when reading price action.
# from input all the way down to plot is merely a copy/paste of the traditional PSAR study. Below that is the additional lines added to the code to create audible and visual alerts + chart label.
input accelerationFactor = 0.02;
input accelerationLimit = 0.2;
assert(accelerationFactor > 0, "'acceleration factor' must be positive: " + accelerationFactor);
assert(accelerationLimit >= accelerationFactor, "'acceleration limit' (" + accelerationLimit + ") must be greater than or equal to 'acceleration factor' (" + accelerationFactor + ")");
def state = {default init, long, short};
def extreme;
def SAR;
def acc;
switch (state[1]) {
case init:
state = state.long;
acc = accelerationFactor;
extreme = high;
SAR = low;
case short:
if (SAR[1] < high)
then {
state = state.long;
acc = accelerationFactor;
extreme = high;
SAR = extreme[1];
} else {
state = state.short;
if (low < extreme[1])
then {
acc = min(acc[1] + accelerationFactor, accelerationLimit);
extreme = low;
} else {
acc = acc[1];
extreme = extreme[1];
}
SAR = max(max(high, high[1]), SAR[1] + acc * (extreme - SAR[1]));
}
case long:
if (SAR[1] > low)
then {
state = state.short;
acc = accelerationFactor;
extreme = low;
SAR = extreme[1];
} else {
state = state.long;
if (high > extreme[1])
then {
acc = min(acc[1] + accelerationFactor, accelerationLimit);
extreme = high;
} else {
acc = acc[1];
extreme = extreme[1];
}
SAR = min(min(low, low[1]), SAR[1] + acc * (extreme - SAR[1]));
}
}
plot parSAR = SAR;
parSAR.SetPaintingStrategy(PaintingStrategy.POINTS);
parSAR.SetDefaultColor(color.BLUE);
#code below this line creates a visible alert (chart label) and audible alert on the first bar the PSAR dots flip (price crosses PSAR)
# because of the copy/paste of tradtional PSAR study above this it is easy to use that to create the below def and plot with simple lines of code.
def PSAR = ParabolicSAR(accelerationFactor = accelerationFactor, accelerationLimit = accelerationLimit);
plot BullishSignal = Crosses(PSAR, close, CrossingDirection.BELOW);
BullishSignal.SetLineWeight(5);
BullishSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BullishSignal.AssignValueColor(CreateColor(51, 204, 0));
# in Alert you select what text will appear in the messages window when your alert trigers by placing those words between quotation marks. Alert(condition or trigger, words to appear, how often to sound the alert, what sound to hear)
Alert(BullishSignal, "Bullish PSAR", Alert.BAR, Sound.Ring);
AddLabel(close > PSAR, " Bullish PSAR ", CreateColor(51,204,0));
# Because BullishSignal will be true ONLY for the bar where the PSAR dots flip, this label is a visual alert that will ONLY appear at the time the PSAR dots flip
AddLabel(if BullishSignal == 1 then yes else no, " PSAR just flipped to Bullish ", (CreateColor(51,204,0)));
plot BearishSignal = Crosses(PSAR, close, CrossingDirection.ABOVE);
BearishSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
BearishSignal.AssignValueColor(Color.RED);
BearishSignal.SetLineWeight(5);
# Because BeaarishSignal will be true ONLY for the bar where the PSAR dots flip, this label is a visual alert that will ONLY appear at the time the PSAR dots flip
Alert(BearishSignal, "Bearish PSAR", Alert.BAR, Sound.Ring);
AddLabel(close < PSAR, " Bearish PSAR ", color.RED);
AddLabel(if BearishSignal == 1 then yes else no, " PSAR just flipped to Bearish ", color.RED);
I'm not that new to scanning and do it most every day. But for some reason I did what you said 1-8 and scanned saved the study and called it just like it say. But I get no results can anyone help out? I've tried limiting the search to NYSE or NAS and $10-20 stocks but no hits I even changed it from 1 bar ago to upto 3 bars ago and nothing. Not sure what I'm missing.@Picard to use the script in post# 1385 in the TOS scanner
Copy the code
In Studies, click Create
Paste the above study
Name the study: Trend_Reversal_Scanner
Save
Click on the scanner.
I didn't write this script. Any questions should be referred to the original poster. HTH
- Click on +Add filter
- Click on the pencil icon next to the filter you just added
- Click edit
- In the left column, click on the 1st pull-down window, click study
- Type in Trend_Reversal_Scanner
- Under Plot, click on the pull-down window, choose upArrow
- In the middle column, choose is true
- Save
Did you manage to find something similar on tradingview? please let me know.Hi @BenTen , is this indicator available for Tradingview also?
@BenTen Is there a certain time to run scans? I ran one and got about 75 Stocks and tried running it since same scan and script errors out. Didn't know if the TOS Server was to busy or, figured if you have used it maybe you could give me some pointers? Like with in 3 bars or what ever thanks.... Just seems like I keep getting Error: Script Execution Timeout.@mikeraya Been using it for awhile.
@BenTen Is there a certain time to run scans? I ran one and got about 75 Stocks and tried running it since same scan and script errors out. Didn't know if the TOS Server was to busy or, figured if you have used it maybe you could give me some pointers? Like with in 3 bars or what ever thanks.... Just seems like I keep getting Error: Script Execution Timeout.
Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Repaints Enhanced Trend Reversal Indicator for ThinkorSwim | Indicators | 122 | ||
Reversal Candles (Saikou / Hikui) Trend Change for ThinkorSwim | Indicators | 10 | ||
LNL Trend System for ThinkOrSwim | Indicators | 25 | ||
L3 Banker Fund Flow Trend Oscillator for ThinkOrSwim | Indicators | 33 | ||
Trend Meter For ThinkOrSwim | Indicators | 38 |
Start a new thread and receive assistance from our community.
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.
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.