Convert TradingView Indicator to ThinkorSwim

javin82

New member
I need help converting a pine script indicator into a think script study for Thinkorswim. The name of the indicator is called Range. It is a reversal indicator and plots long and short signals. If you can help me with this, please let me know. Thank you!

PineScript code below:
Code:
//////////////
//@version=3
study("Range fv2",overlay=true)
showTrendLine = input(false, title="Show Trend Line")
colorBars = input(true, title="Color Bars?")
filterTrend = input(true, title="Filter Trend?")

//Source
src = close

//Sampling Period
per = input(defval=25, minval=1, title="Sampling Period")

//Range Multiplier
mult = input(defval=2, minval=0, title="Range Multiplier")

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Definitions
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Smooth Average Range
smoothrng(x, t, m)=>
    wper      = (t/3) - 1
    avrng     = sma(abs(x - x[1]), t)
    smoothrng = sma(avrng, wper)*m
    smoothrng
smrng = smoothrng(src, per, mult)

//Range Filter
rngfilt(x, r)=>
    rngfilt  = x
    rngfilt := x > nz(rngfilt[1]) ? ((x - r) < nz(rngfilt[1]) ? nz(rngfilt[1]) : (x - r)) : ((x + r) > nz(rngfilt[1]) ? nz(rngfilt[1]) : (x + r))
    rngfilt
filt = rngfilt(src, smrng)

//Filter Direction
upward   = 0.0
upward  := filt > filt[1] ? nz(upward[1]) + 1 : filt < filt[1] ? 0 : nz(upward[1])
downward = 0.0
downward := filt < filt[1] ? nz(downward[1]) + 1 : filt > filt[1] ? 0 : nz(downward[1])

//Target Bands
hband = filt + smrng
lband = filt - smrng

//Colors
filtcolor = upward > 0 ? lime : downward > 0 ? red : orange
barcolor  = (src > filt) and (src > src[1]) and (upward > 0) ? lime : (src > filt) and (src < src[1]) and (upward > 0) ? green : (src < filt) and (src < src[1]) and (downward > 0) ? red : (src < filt) and (src > src[1]) and (downward > 0) ? maroon : orange
barcolor(colorBars ? barcolor : na)

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Plots
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Range Filter
if filterTrend == true
    showTrendLine := false
filtplot = plot(filterTrend ? filt : na, color=filtcolor, linewidth=4, title="Range Filter")
//
Factor=input(3, minval=1,maxval = 100)
Pd=input(3, minval=1,maxval = 100)

Up=hl2-(Factor*atr(Pd))
Dn=hl2+(Factor*atr(Pd))
TrendUp = 0.0
TrendDown = 0.0
linecolor = na
up = na
down = na
Tsl = 0.0
Trend = 0.0
TrendUp := close[1]>TrendUp[1]? max(Up,TrendUp[1]) : Up
TrendDown := close[1]<TrendDown[1]? min(Dn,TrendDown[1]) : Dn
Trend := close > TrendDown[1] ? 1: close< TrendUp[1]? -1: nz(Trend[1],1)
Tsl := Trend==1? TrendUp: TrendDown
linecolor := Trend == 1 ? green : red
plot(showTrendLine ? Tsl : na, color = linecolor , style = line , linewidth = 3,title = "SuperTrend")

// Strategy


longCond = na
shortCond = na
longCond :=crossunder(Tsl,filt)
shortCond :=crossover(Tsl,filt)

// Count your long short conditions for more control with Pyramiding

sectionLongs = 0
sectionLongs := nz(sectionLongs[1])
sectionShorts = 0
sectionShorts := nz(sectionShorts[1])

if longCond
    sectionLongs := sectionLongs + 1
    sectionShorts := 0

if shortCond
    sectionLongs := 0
    sectionShorts := sectionShorts + 1

// Pyramiding

pyrl = 1


// These check to see your signal and cross references it against the pyramiding settings above

longCondition = longCond and sectionLongs <= pyrl
shortCondition = shortCond and sectionShorts <= pyrl

// Get the price of the last opened long or short

last_open_longCondition = na
last_open_shortCondition = na
last_open_longCondition := longCondition ? open : nz(last_open_longCondition[1])
last_open_shortCondition := shortCondition ? open : nz(last_open_shortCondition[1])

// Check if your last postion was a long or a short

last_longCondition = na
last_shortCondition = na
last_longCondition := longCondition ? time : nz(last_longCondition[1])
last_shortCondition := shortCondition ? time : nz(last_shortCondition[1])

in_longCondition = last_longCondition > last_shortCondition
in_shortCondition = last_shortCondition > last_longCondition

// Take profit

isTPl = input(true, "Take Profit Long")
isTPs = input(true, "Take Profit Short")
tp = input(5, "Take Profit ", type=float)
long_tp = isTPl and crossover(high, (1+(tp/100))*last_open_longCondition) and longCondition == 0 and in_longCondition  == 1
short_tp = isTPs and crossunder(low, (1-(tp/100))*last_open_shortCondition) and shortCondition == 0 and in_shortCondition == 1


// Create a single close for all the different closing conditions.

long_close = long_tp  ? 1 : 0
short_close = short_tp ? 1 : 0

// Get the time of the last close

last_long_close = na
last_short_close = na
last_long_close := long_close ? time : nz(last_long_close[1])
last_short_close := short_close ? time : nz(last_short_close[1])


// Alerts & Signals

bton(b) => b ? 1 : 0
plotshape(longCondition , title="Long", color=green, textcolor=green, transp=0,
          style=shape.triangleup, location=location.belowbar, size=size.small,text="LONG",offset=0)


plotshape(shortCondition, title="Short", color=red, textcolor=red, transp=0,
          style=shape.triangledown, location=location.abovebar, size=size.small,text="SHORT",offset=0)


//plotshape(longCondition, title = "BUY Signal", text = "Buy", style=shape.triangleup, location=location.belowbar, color = blue, editable = false, transp = 0)
//plotshape(shortCondition, title = "SELL Signal", text = "Sell", style=shape.triangledown, location=location.abovebar, color = black, editable = false, transp = 0)

plotshape(long_tp and last_longCondition > nz(last_long_close[1]), text ="TP", title="Take Profit Long", style=shape.triangledown,
   location=location.abovebar, color = red, editable = false, transp = 0)
plotshape(short_tp and last_shortCondition > nz(last_short_close[1]) , text ="TP", title="Take Profit Short", style=shape.triangleup,
   location=location.belowbar, color = lime, editable = false, transp = 0)

alertcondition(bton(longCondition), title="Long Alert")
alertcondition(bton(shortCondition), title="Short Alert")
alertcondition(bton(long_tp and last_longCondition > nz(last_long_close[1])), title="Take Profit Long")
alertcondition(bton(short_tp and last_shortCondition > nz(last_short_close[1])), title="Take Profit Short")

Any help I can get with this will be greatly appreciated! Thank you!

Admin's Notes:

You can now use this thread to make your own request. If there is a TradingView script that you would like to see in ThinkorSwim, please post the source code and link to that script below. We'll try our best to help you with the conversion.

Below are the TradingView scripts that have been converted to TOS.
 
Last edited by a moderator:

New Indicator: Buy the Dip

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.

Download the indicator

rad14733

Well-known member
VIP
@joe362 There is no "converter" to convert code between trading platforms, it all has to be done manually... Some conversions from Pinescript to Thinkscript are quick and easy while others are more laborious... None convert instantly which is why we urge members to learn Thinkscript... I've had to learn as much as I know about Pinescript for my own needs in Thinkscript but that doesn't mean I want to tackle everyone else's conversions for them... Especially not if there happens to be a comparable or modifiable Study in Thinkscript already...
 

joe362

Member
@joe362 There is no "converter" to convert code between trading platforms, it all has to be done manually... Some conversions from Pinescript to Thinkscript are quick and easy while others are more laborious... None convert instantly which is why we urge members to learn Thinkscript... I've had to learn as much as I know about Pinescript for my own needs in Thinkscript but that doesn't mean I want to tackle everyone else's conversions for them... Especially not if there happens to be a comparable or modifiable Study in Thinkscript already...
@rad14733
Thanks for sharing
 
Last edited:

MerryDay

Well-known member
VIP
@joe362 That is because there was never any instruction to "dropped the link on the code icon".
Keep trying. Read the instructions carefully, just as you do when you are analyzing charts. You will get it.
 

rad14733

Well-known member
VIP
@MerryDay
Do you have an email so I can sent it to you, an image and a link .

You can post your image and link here... Members should not be luring members off-site for support for a multitude of reasons, personal security being a biggie... If you really need on-on-one support, that can be provided via the usethinkscript Discord channel... I and several other members provide one-on-one help there almost daily in addition to what you see here...
 

AK408

New member
Hello Traders!!
I have been using this strategy on trading view for a while with decent profits.
I need to somehow use this strategy on Thinkorswim, I am not sure if this code will work directly in Thinkorswim or it needs to be modified.
I appreciate any help!!

:

Here's the code!!!

Code:
//This is slightly modified SuperTrend Script.

//1.Buy when all three lines are Green and cover the position even one green become Red line
//2.Sell when all the three line are red and cove the position even one become Green.
//@version=2
//Test
//
study("ST", shorttitle="Candle", overlay=true)
// --------------- Calculating HA Candle's values

plotcandle(open, high, low, close, title='candle', color=(open < close) ? green : red, wickcolor=gray)
// END

//The below is Super Trend Strategy
Factor1=input(1,type =float, minval=1,maxval = 100)
Factor2=input(2,type =float, minval=1,maxval = 100)
Factor3=input(3,type =float, minval=1,maxval = 100)
Pd1=input(10,minval=1,maxval = 100)
Pd2=input(10,minval=1,maxval = 100)
Pd3=input(10,minval=1,maxval = 100)
//ST 1
Up1=hl2-(Factor1*atr(Pd1))
Up2=hl2-(Factor2*atr(Pd2))
Up3=hl2-(Factor3*atr(Pd3))
Dn1=hl2+(Factor1*atr(Pd1))
Dn2=hl2+(Factor2*atr(Pd2))
Dn3=hl2+(Factor3*atr(Pd3))
//ST1
TrendUp1=close[1]>TrendUp1[1]? max(Up1,TrendUp1[1]) : Up1
TrendUp2=close[1]>TrendUp2[1]? max(Up2,TrendUp2[1]) : Up2
TrendUp3=close[1]>TrendUp3[1]? max(Up3,TrendUp3[1]) : Up3

TrendDown1=close[1]<TrendDown1[1]? min(Dn1,TrendDown1[1]) : Dn1
TrendDown2=close[1]<TrendDown2[1]? min(Dn2,TrendDown2[1]) : Dn2
TrendDown3=close[1]<TrendDown3[1]? min(Dn3,TrendDown3[1]) : Dn3

Trend1 = close > TrendDown1[1] ? 1: close< TrendUp1[1]? -1: nz(Trend1[1],1)
Tsl1 = Trend1==1? TrendUp1: TrendDown1
Trend2 = close > TrendDown2[1] ? 1: close< TrendUp2[1]? -1: nz(Trend2[1],1)
Tsl2 = Trend2==1? TrendUp2: TrendDown2
Trend3 = close > TrendDown3[1] ? 1: close< TrendUp3[1]? -1: nz(Trend3[1],1)
Tsl3 = Trend3==1? TrendUp3: TrendDown3

linecolor1 = Trend1 == 1 ? yellow : red
linecolor2 = Trend2 == 1 ? green : red
linecolor3 = Trend3 == 1 ? #7FFF00 : red

plot(Tsl1, color = linecolor1 , style = line , linewidth = 2,title = "SuperTrend1")
plot(Tsl2, color = linecolor2 , style = line , linewidth = 2,title = "SuperTrend2")
plot(Tsl3, color = linecolor3 , style = line , linewidth = 2,title = "SuperTrend3")

plotshape(cross(close,Tsl1) and close>Tsl1 , "UpShape1", shape.flag,location.bottom,yellow,0,0)
plotshape(cross(Tsl1,close) and close<Tsl1 , "DownShape1", shape.triangledown , location.bottom, red,0,0)
//plot(Trend==1 and Trend[1]==-1,color = linecolor, style = circles, linewidth = 3,title="Trend")

plotshape(cross(close,Tsl2) and close>Tsl2 , "UpShape2", shape.triangleup,location.bottom,green,0,0)
plotshape(cross(Tsl2,close) and close<Tsl2 , "DownShape2", shape.triangledown , location.bottom, red,0,0)
//plot(Trend==1 and Trend[1]==-1,color = linecolor, style = circles, linewidth = 3,title="Trend")

plotshape(cross(close,Tsl3) and close>Tsl3 , "UpShape1", shape.triangleup,location.bottom,green,0,0)
plotshape(cross(Tsl3,close) and close<Tsl3 , "DownShape2", shape.triangledown , location.bottom, red,0,0)
//plot(Trend==1 and Trend[1]==-1,color = linecolor, style = circles, linewidth = 3,title="Trend")

plotarrow(Trend1 == 1 and Trend1[1] == -1 ? Trend1 : na, title="UpSTArrow1", colorup=lime, maxheight=60, minheight=50, transp=0)
plotarrow(Trend1 == -1 and Trend1[1] == 1 ? Trend1 : na, title="DnSTArrow1", colordown=red, maxheight=60, minheight=50, transp=0)
//ST2
plotarrow(Trend2 == 1 and Trend2[1] == -1 ? Trend2 : na, title="UpSTArrow2", colorup=lime, maxheight=60, minheight=50, transp=0)
plotarrow(Trend2 == -1 and Trend2[1] == 1 ? Trend2 : na, title="DnSTArrow2", colordown=red, maxheight=60, minheight=50, transp=0)
//ST3
plotarrow(Trend3 == 1 and Trend3[1] == -1 ? Trend3 : na, title="UpSTArrow3", colorup=lime, maxheight=60, minheight=50, transp=0)
plotarrow(Trend3 == -1 and Trend3[1] == 1 ? Trend3 : na, title="DnSTArrow3", colordown=red, maxheight=60, minheight=50, transp=0)


//Alert code :
alertcondition(Tsl1 == TrendUp1 and Tsl1[1] == TrendDown1 ? true : na, title='Up Entry Arrow', message='Up Entry Arrow!')
alertcondition(Tsl1 == TrendDown1 and Tsl1[1] == TrendUp1 ? true : na, title='Down Entry Arrow', message='Down Entry Arrow!')
 

joe362

Member
@rad14733 @MerryDay
Thanks for your support to our community and my question, after many times I tired to post the image and finally I can post something.
Here is an image. That indicator is Weis Wave Volume on the trading view platform.
Can you help me to covert trading view indicator thimorswim.
(here is the link https://www.tradingview.com/script/QrCFs0K2-Weis-Wave-Volume/ )
mKzB5gY.png

and the code

Code:
//@version=4
study("Weis Wave Volume", shorttitle="WWV", overlay=false, resolution="")
method = input(defval="ATR", options=["ATR", "Traditional", "Part of Price"], title="Renko Assignment Method")
methodvalue = input(defval=14.0, type=input.float, minval=0, title="Value")
pricesource = input(defval="Close", options=["Close", "Open / Close", "High / Low"], title="Price Source")
useClose = pricesource == "Close"
useOpenClose = pricesource == "Open / Close" or useClose
useTrueRange = input(defval="Auto", options=["Always", "Auto", "Never"], title="Use True Range instead of Volume")
isOscillating = input(defval=false, type=input.bool, title="Oscillating")
normalize = input(defval=false, type=input.bool, title="Normalize")
vol = useTrueRange == "Always" or useTrueRange == "Auto" and na(volume) ? tr : volume
op = useClose ? close : open
hi = useOpenClose ? close >= op ? close : op : high
lo = useOpenClose ? close <= op ? close : op : low

if method == "ATR"
    methodvalue := atr(round(methodvalue))
if method == "Part of Price"
    methodvalue := close / methodvalue

currclose = float(na)
prevclose = nz(currclose[1])
prevhigh = prevclose + methodvalue
prevlow = prevclose - methodvalue
currclose := hi > prevhigh ? hi : lo < prevlow ? lo : prevclose

direction = int(na)
direction := currclose > prevclose ? 1 : currclose < prevclose ? -1 : nz(direction[1])
directionHasChanged = change(direction) != 0
directionIsUp = direction > 0
directionIsDown = direction < 0

barcount = 1
barcount := not directionHasChanged and normalize ? barcount[1] + barcount : barcount
vol := not directionHasChanged ? vol[1] + vol : vol
res = barcount > 1 ? vol / barcount : vol

plot(isOscillating and directionIsDown ? -res : res, style=plot.style_columns, color=directionIsUp ? color.green : color.red, transp=75, linewidth=3, title="Wave Volume")
 

MerryDay

Well-known member
VIP
@AK408 Do not be surprised if no one expresses any interest in doing a conversion of your script as we already have a plethora of SuperTrends so unfortunately there might not be any interest. Also, SuperTrends are notorious for being to be too complex to run in TOS scanners and watchlists making them of limited use and limited interest.

If you find this indicator that helpful to your strategy, you should be willing to do the work to attempt to start to write the conversion yourself even if you have never attempted any coding before. Showing that you are willing to participate in the pain, the time, and the work involved usually attracts someone on here to rally to your cause. You can look at the other SuperTrends on this forum and cut and paste the snippets of the code that are doing the same things. When you get to the more complex part of the code; you can come back and ask specific questions.

My experience has been while many of us on this forum are too busy with our own lives and with our own trading to take on the conversion of an entire script; we share our knowledge unselfishly if it is a simple question of solving a syntax or logic problem.

Do not be overwhelmed or think that you can't write a script. Thinkscript looks like a foreign language at first but after a brief period of acclimating to the syntax, much of Thinkscript is straight-forward simple logic. Here is a great place to start w/ any specific questions: The TOS Learn Center. Where If you're looking for tutorials, references, or quick guides, stop: everything's right here. Take a look around!

Basically, your choices come down to showing the community that you are willing to make this a group effort by starting the conversion on your own, trying to make one of the other SuperTrends work for you, or living without it.

HTH
 

MerryDay

Well-known member
VIP
@joe362 You know that I am going to post and ask you to show marked-up screenshots of the differences between this Weis Wave indicator you asking for conversion of and the Weis Wave Indicators that you have already looked at on this forum when you did your research such as this one:
https://usethinkscript.com/threads/weis-wave-volume-indicator-for-thinkorswim.72/
Because this all has been part of discussions in your previous posts. Different Indicator same questions.

So is this a continuing issue with your difficulty in posting screenshots? If so, you need to explain step by step, every single step, of what you are doing and what errors you are encountering.
 

joe362

Member
@MerryDay
sorry to bother you about that, I mean the different indicator. I post the wrong one.
The last time, we are discussing about the Optimized Trend Tracker indicator not the Weis Wave indicator.
sorry @MerryDay

cDWDh5t.png


and the code
Code:
//@version=4
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © KivancOzbilgic

//created by: @Anil_Ozeksi
//developer: ANIL ÖZEKŞİ
//author: @kivancozbilgic

study("Optimized Trend Tracker","OTT", overlay=true)
src = input(close, title="Source")
length=input(2, "OTT Period", minval=1)
percent=input(1.4, "OTT Percent", type=input.float, step=0.1, minval=0)
showsupport = input(title="Show Support Line?", type=input.bool, defval=true)
showsignalsk = input(title="Show Support Line Crossing Signals?", type=input.bool, defval=true)
showsignalsc = input(title="Show Price/OTT Crossing Signals?", type=input.bool, defval=false)
highlight = input(title="Show OTT Color Changes?", type=input.bool, defval=false)
showsignalsr = input(title="Show OTT Color Change Signals?", type=input.bool, defval=false)
highlighting = input(title="Highlighter On/Off ?", type=input.bool, defval=true)
mav = input(title="Moving Average Type", defval="VAR", options=["SMA", "EMA", "WMA", "TMA", "VAR", "WWMA", "ZLEMA", "TSF"])
Var_Func(src,length)=>
    valpha=2/(length+1)
    vud1=src>src[1] ? src-src[1] : 0
    vdd1=src<src[1] ? src[1]-src : 0
    vUD=sum(vud1,9)
    vDD=sum(vdd1,9)
    vCMO=nz((vUD-vDD)/(vUD+vDD))
    VAR=0.0
    VAR:=nz(valpha*abs(vCMO)*src)+(1-valpha*abs(vCMO))*nz(VAR[1])
VAR=Var_Func(src,length)
Wwma_Func(src,length)=>
    wwalpha = 1/ length
    WWMA = 0.0
    WWMA := wwalpha*src + (1-wwalpha)*nz(WWMA[1])
WWMA=Wwma_Func(src,length)
Zlema_Func(src,length)=>
    zxLag = length/2==round(length/2) ? length/2 : (length - 1) / 2
    zxEMAData = (src + (src - src[zxLag]))
    ZLEMA = ema(zxEMAData, length)
ZLEMA=Zlema_Func(src,length)
Tsf_Func(src,length)=>
    lrc = linreg(src, length, 0)
    lrc1 = linreg(src,length,1)
    lrs = (lrc-lrc1)
    TSF = linreg(src, length, 0)+lrs
TSF=Tsf_Func(src,length)
getMA(src, length) =>
    ma = 0.0
    if mav == "SMA"
        ma := sma(src, length)
        ma

    if mav == "EMA"
        ma := ema(src, length)
        ma

    if mav == "WMA"
        ma := wma(src, length)
        ma

    if mav == "TMA"
        ma := sma(sma(src, ceil(length / 2)), floor(length / 2) + 1)
        ma

    if mav == "VAR"
        ma := VAR
        ma

    if mav == "WWMA"
        ma := WWMA
        ma

    if mav == "ZLEMA"
        ma := ZLEMA
        ma

    if mav == "TSF"
        ma := TSF
        ma
    ma
    
MAvg=getMA(src, length)
fark=MAvg*percent*0.01
longStop = MAvg - fark
longStopPrev = nz(longStop[1], longStop)
longStop := MAvg > longStopPrev ? max(longStop, longStopPrev) : longStop
shortStop =  MAvg + fark
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := MAvg < shortStopPrev ? min(shortStop, shortStopPrev) : shortStop
dir = 1
dir := nz(dir[1], dir)
dir := dir == -1 and MAvg > shortStopPrev ? 1 : dir == 1 and MAvg < longStopPrev ? -1 : dir
MT = dir==1 ? longStop: shortStop
OTT=MAvg>MT ? MT*(200+percent)/200 : MT*(200-percent)/200
plot(showsupport ? MAvg : na, color=#0585E1, linewidth=2, title="Support Line")
OTTC = highlight ? OTT[2] > OTT[3] ? color.green : color.red : #B800D9
pALL=plot(nz(OTT[2]), color=OTTC, linewidth=2, title="OTT", transp=0)
alertcondition(cross(OTT[2], OTT[3]), title="Color ALARM", message="OTT Has Changed Color!")
alertcondition(crossover(OTT[2], OTT[3]), title="GREEN ALERT", message="OTT GREEN BUY SIGNAL!")
alertcondition(crossunder(OTT[2], OTT[3]), title="RED ALERT", message="OTT RED SELL SIGNAL!")
alertcondition(cross(MAvg, OTT[2]), title="Cross Alert", message="OTT - Support Line Crossing!")
alertcondition(crossover(MAvg, OTT[2]), title="Crossover Alarm", message="Support Line BUY SIGNAL!")
alertcondition(crossunder(MAvg, OTT[2]), title="Crossunder Alarm", message="Support Line SELL SIGNAL!")
alertcondition(cross(src, OTT[2]), title="Price Cross Alert", message="OTT - Price Crossing!")
alertcondition(crossover(src, OTT[2]), title="Price Crossover Alarm", message="PRICE OVER OTT - BUY SIGNAL!")
alertcondition(crossunder(src, OTT[2]), title="Price Crossunder Alarm", message="PRICE UNDER OTT - SELL SIGNAL!")
buySignalk = crossover(MAvg, OTT[2])
plotshape(buySignalk and showsignalsk ? OTT*0.995 : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0)
sellSignallk = crossunder(MAvg, OTT[2])
plotshape(sellSignallk and showsignalsk ? OTT*1.005 : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0)
buySignalc = crossover(src, OTT[2])
plotshape(buySignalc and showsignalsc ? OTT*0.995 : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0)
sellSignallc = crossunder(src, OTT[2])
plotshape(sellSignallc and showsignalsc ? OTT*1.005 : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0)
mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0,display=display.none)
longFillColor = highlighting ? (MAvg>OTT ? color.green : na) : na
shortFillColor = highlighting ? (MAvg<OTT ? color.red : na) : na
fill(mPlot, pALL, title="UpTrend Highligter", color=longFillColor)
fill(mPlot, pALL, title="DownTrend Highligter", color=shortFillColor)
buySignalr = crossover(OTT[2], OTT[3])
plotshape(buySignalr and showsignalsr ? OTT*0.995 : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0)
sellSignallr = crossunder(OTT[2], OTT[3])
plotshape(sellSignallr and showsignalsr ? OTT*1.005 : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0)
 

joe362

Member
@joe362 You know that I am going to post and ask you to show marked-up screenshots of the differences between this Weis Wave indicator you asking for conversion of and the Weis Wave Indicators that you have already looked at on this forum when you did your research such as this one:
https://usethinkscript.com/threads/weis-wave-volume-indicator-for-thinkorswim.72/
Because this all has been part of discussions in your previous posts. Different Indicator same questions.

So is this a continuing issue with your difficulty in posting screenshots? If so, you need to explain step by step, every single step, of what you are doing and what errors you are encountering.


@MerryDay
I think I clink the wrong icon as insert image on the left corner not the toggle BB code. that's why I cant post the image to show you the indicator I'm looking for. Thanks for your fast responding and your hard work.
 

MerryDay

Well-known member
VIP
@joe362 So to sum up, you no longer are looking to have the weis wave or OTT indicators converted. And if you ever do want them converted you now know how to post screenshots of what modifications you are actually asking for when you compare them to the already existing trend and weis wave indicators on this forum already.

Excellent! Good trading!
 

joe362

Member
@joe362 So to sum up, you no longer are looking to have the weis wave or OTT indicators converted. And if you ever do want them converted you now know how to post screenshots of what modifications you are actually asking for when you compare them to the already existing trend and weis wave indicators on this forum already.

Excellent! Good trading!
@MerryDay
In the fact, I still need help on the OTT indicator. Can you help me out on that one?
If you can't, I am so sorry to bother your time to read and responding my question.
I posted the image and the code on the #312.
 

MerryDay

Well-known member
VIP
@joe362 The OTT looks like several of our trend indicators, I will grab some screenshots and see if any of them can be made to do what the OTT does. The indication of timeframe is cutoff on the screenshot. What timeframe/duration is that?

It is important to post a screenshot of the complete chart when asking questions. That way, even if you leave details out of your post, posters on this forum can use all the details shown in the screenshot to try and replicate it.
HTH
 

joe362

Member
@joe362 The OTT looks like several of our trend indicators, I will grab some screenshots and see if any of them can be made to do what the OTT does. The indication of timeframe is cutoff on the screenshot. What timeframe/duration is that?

It is important to post a screenshot of the complete chart when asking questions. That way, even if you leave details out of your post, posters on this forum can use all the details shown in the screenshot to try and replicate it.
HTH
@MerryDay

Great, Thanks to correct me how to post for the help, this was the first time to post something.
The timeframe is 15 min and here the full screenshot and all the data I know about the OTT indicator.

Q39I8q6.png
 

MerryDay

Well-known member
VIP
You did notice the inherent weakness in trend indicators in that screenshot you posted correct? That is quite a few false signals for the one true one Using another trend indicator such as RSI will not completely filter them out. Moving averages are good for confirming trends but generally, you need a strategy w/ an additional indicator for entry and exit signals.
Here is a post for Basic Elements For A Good Strategy. Be sure to click on the links in the post they provide invaluable information
 

pebbles

New member
Code from trading view, would like to transfer over to thinkorswim so i can pair with more indicators there rather than trading view. All help greatly appreciated.Link to trading view code & indicator

Code:
//
// @author LazyBear
//
// If you use this code in its original/modified form, do drop me a note.
//

study(title = "Volume Flow Indicator [LazyBear]", shorttitle="VFI_LB")

length = input(130, title="VFI length")
coef = input(0.2)
vcoef = input(2.5, title="Max. vol. cutoff")
signalLength=input(5)
smoothVFI=input(false, type=bool)

ma(x,y) => smoothVFI ? sma(x,y) : x

typical=hlc3
inter = log( typical ) - log( typical[1] )
vinter = stdev(inter, 30 )
cutoff = coef * vinter * close
vave = sma( volume, length )[1]
vmax = vave * vcoef
vc = iff(volume < vmax, volume, vmax) //min( volume, vmax )
mf = typical - typical[1]
vcp = iff( mf > cutoff, vc, iff ( mf < -cutoff, -vc, 0 ) )

vfi = ma(sum( vcp , length )/vave, 3)
vfima=ema( vfi, signalLength )
d=vfi-vfima

plot(0, color=gray, style=3)
showHisto=input(false, type=bool)
plot(showHisto ? d : na, style=histogram, color=gray, linewidth=3, transp=50)
plot( vfima , title="EMA of vfi", color=orange)
plot( vfi, title="vfi", color=green,linewidth=2)
 

rad14733

Well-known member
VIP
@pebbles Welcome to the usethinkscript forums...

I wish I had a dollar for every time I've had to type this out to new members - literally numerous times per day... I guess I should create a topic to point members to... We don't generally just convert code upon request without ample interest and definitely not for members who join simply to ask others to do their work for them... These forums are for freely sharing code you have written or converted, not for members to code for others... usethinkscript is intended to help members learn how the help themselves... If you'd like to try converting the code we're willing to help you along... Also, have you done a site search to insure that there isn't a comparable script here already...??? Doing ample research before posting is an expectation and considered good forum etiquette...
 

Volatility Trading Range

VTR is a momentum indicator that shows if a stock is overbought or oversold based on its Weekly and Monthly average volatility trading range.

Download the indicator

Similar threads

Top