Repaints MTF StochRSI For ThinkOrSwim

Repaints

HighBredCloud

Well-known member
Can't seem to figure this out...Where would I put this line of code to turn regular StochRSI into MTF?
 
Last edited by a moderator:

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

The "input RSI_price = close" try changing that to a "def RSI_price = close". The close doesn't seem to like be an input.

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2008-2020
#

declare lower;

input RSI_length = 14;
input over_bought = 80;
input over_sold = 20;
input RSI_average_type = AverageType.WILDERS;
input KPeriod = 14;
input DPeriod = 3;
input slowing_period = 1;
input averageType = AverageType.SIMPLE;
input showBreakoutSignals = {default "No", "On FullK", "On FullD", "On FullK & FullD"};
input aggregationPeriod = AggregationPeriod.FIFTEEN_MIN;

def RSI_price = close(period = aggregationPeriod);

def RSI = RSI(price = RSI_price, length = RSI_length, averageType = RSI_average_type);

plot FullK = StochasticFull(over_bought, over_sold, KPeriod, DPeriod, RSI, RSI, RSI, slowing_period, averageType).FullK;
plot FullD = StochasticFull(over_bought, over_sold, KPeriod, DPeriod, RSI, RSI, RSI, slowing_period, averageType).FullD;
plot OverBought = over_bought;
plot OverSold = over_sold;

def upK = FullK crosses above OverSold;
def upD = FullD crosses above OverSold;
def downK = FullK crosses below OverBought;
def downD = FullD crosses below OverBought;

plot UpSignal;
plot DownSignal;
switch (showBreakoutSignals) {
case "No":
    UpSignal = Double.NaN;
    DownSignal = Double.NaN;
case "On FullK":
    UpSignal = if upK then OverSold else Double.NaN;
    DownSignal = if downK then OverBought else Double.NaN;
case "On FullD":
    UpSignal = if upD then OverSold else Double.NaN;
    DownSignal = if downD then OverBought else Double.NaN;
case "On FullK & FullD":
    UpSignal = if upK or upD then OverSold else Double.NaN;
    DownSignal = if downK or downD then OverBought else Double.NaN;
}

UpSignal.setHiding(showBreakoutSignals == showBreakoutSignals."No");
DownSignal.setHiding(showBreakoutSignals == showBreakoutSignals."No");

FullK.SetDefaultColor(GetColor(5));
FullD.SetDefaultColor(GetColor(0));
OverBought.SetDefaultColor(GetColor(1));
OverSold.SetDefaultColor(GetColor(1));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
 
Can you make this script into a watch list indicator to show arrow or something on my watchlist when up arrow appears on the stochrsi
 
@stocksniper
I set up your SVEStochRSI Watchlist but I didn't bother to do this one because a scan didn't find any stocks
that had these up or down arrows so there isn't anything to watch?

If you still want it, you can set it up, yourself, using the SVEStochRSI watchlist as your example.
The StochRSI is the exact same just replace the 'SVEStochRSI ' with 'StochRSI' .
 
Last edited:
Hey Guys, can someone here help me with some code. I am trying to add some arrows in TOS however they are forming at the bottom of the chart. would really appreciate it.

Code:
def CountChg;
def SOAPCount;

def k1v = Max(-100, Min(100, (StochasticFull(KPeriod = 5, slowing_period = 3))) - 50) / 50.01;
def k2v = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5))) - 50) / 50.01;
def k3v = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5))) - 50) / 50.01;
def R1v = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01;
if k2v > 0
{
    CountChg = if k1v <= k2v and k1v[1] > k2v[1] and k2v[1] > 0 then -1 else 0;
    SOAPCount = CompoundValue(1,  Min (0, SOAPCount[1]) + CountChg, 0);
}
else
{
    CountChg = if k1v >= k2v and k1v[1] < k2v[1] and k2v[1] <= 0 then 1 else 0;
    SOAPCount = CompoundValue (1,  Max (0, SOAPCount[1]) + CountChg, 0);
}

def fish1 = CompoundValue(1, 0.5 * (Log((1 + k1v) / (1 - k1v)) + fish1[1]), 0);
def fish2 = CompoundValue(1,   0.5 * (Log((1 + k2v) / (1 - k2v)) + fish2[1]), 0);
def fish3 = CompoundValue(1, 0.5 * (Log((1 + k3v) / (1 - k3v)) + fish3[1]), 0);
def fish4 = CompoundValue(1, 0.5 * (Log((1 + R1v) / (1 - R1v)) + fish4[1]), 0);



plot BigPinkup = if Sign (fish3 - fish3[1]) > Sign (fish3[1] - fish3[2]) then fish else Double.NaN;
BigPinkup.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
BigPinkup.AssignValueColor(Color.PINK);
 
@BenTen see the complete code below.

Rich (BB code):
declare upper;

#### Fisher Transform Inputs
input length = 10;
input volumeFastLength = 1;
input volumeSlowLength = 20;
input volumeOscThreshold = 0.5;


###################### Calculate Fisher Transform ###########################################
def maxHigh;
def minLow;
def range;
def value;
def truncValue;
def fish;
def FTUpArrow;
def FTDownArrow;
def FTOneBarBack;

maxHigh = Highest(hl2(), length);
minLow = Lowest(hl2(), length);
range = maxHigh - minLow;
value = if IsNaN(hl2()) then Double.NaN else if IsNaN(range)
    then value[1] else if range == 0 then 0 else 0.66 * ((hl2() - minLow) / range - 0.5) + 0.67 * value[1];
truncValue = if value > 0.99 then 0.999 else if value < -0.99 then -0.999 else value;
fish = 0.5 * (Log((1 + truncValue) / (1 - truncValue)) + fish[1]);
FTOneBarBack = fish[1];
FTUpArrow = if (fish[1] < FTOneBarBack[1]) and (fish > FTOneBarBack) then 1 else
    Double.NaN;
FTDownArrow = if (fish[1] > FTOneBarBack[1]) and (fish < FTOneBarBack) then 1 else
    Double.NaN;


# Signal - Plot if FT has crossed above FTOneBarBack and CCI is greater than previous CCI
#plot FSTrendIndicatorUp = if FT[-1] > FT and FT < FT[1] then FT else Double.NaN;
plot fishUPCCIUp = if fish[-1] > fish and fish < fish[1]  then fish else Double.NaN;
fishUPCCIUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
fishUPCCIUp.AssignValueColor(Color.GREEN);


plot fishDownCCIDown = if fish[-1] < fish and fish > fish[1]  then fish else Double.NaN;
fishDownCCIDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
fishDownCCIDown.AssignValueColor(Color.RED);



##### SECOND RED ####################

def CountChg;
def SOAPCount;

def k1v = Max(-100, Min(100, (StochasticFull(KPeriod = 5, slowing_period = 3))) - 50) / 50.01;
def k2v = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5))) - 50) / 50.01;
def k3v = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5))) - 50) / 50.01;
def R1v = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01;
if k2v > 0
{
    CountChg = if k1v <= k2v and k1v[1] > k2v[1] and k2v[1] > 0 then -1 else 0;
    SOAPCount = CompoundValue(1,  Min (0, SOAPCount[1]) + CountChg, 0);
}
else
{
    CountChg = if k1v >= k2v and k1v[1] < k2v[1] and k2v[1] <= 0 then 1 else 0;
    SOAPCount = CompoundValue (1,  Max (0, SOAPCount[1]) + CountChg, 0);
}

def fish1 = CompoundValue(1, 0.5 * (Log((1 + k1v) / (1 - k1v)) + fish1[1]), 0);
def fish2 = CompoundValue(1,   0.5 * (Log((1 + k2v) / (1 - k2v)) + fish2[1]), 0);
def fish3 = CompoundValue(1, 0.5 * (Log((1 + k3v) / (1 - k3v)) + fish3[1]), 0);
def fish4 = CompoundValue(1, 0.5 * (Log((1 + R1v) / (1 - R1v)) + fish4[1]), 0);



plot BigPinkup = if Sign (fish3 - fish3[1]) > Sign (fish3[1] - fish3[2]) then fish else Double.NaN;
BigPinkup.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
BigPinkup.AssignValueColor(Color.PINK);
 
Actually got it to work, by changing "fish" to "low"

How could I get this code working for down arrows? Just the snippet below

Rich (BB code):
plot BigPinkup = if Sign (fish3 - fish3[1]) > Sign (fish3[1] - fish3[2]) then fish else Double.NaN;
BigPinkup.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
BigPinkup.AssignValueColor(Color.PINK)
 
@drdDavi, You get it to work the same way you fixed your other arrows. Only this time, do it by changing "fish" to "high"
HTH
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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