Converting Pinescript (TradingView) indicator to thinkscript (ToS) $10-30 USD $10-30 USD Paid on delivery
I'm looking to convert a Pinescript (TradingView) indicator to thinkscript (thinkorswim). My attempt to translate the code failed (pasted below). I'd like for the indicator to show identical values in both Tradingview and ToS. Please test multiple length inputs to confirm successful conversion.
PineScript Indicator:
trendDetectionLength=input(2)
showDistributionBelowZero=input(false, type=bool)
mov = close>close[1] ? 1 : close<close[1] ? -1 : 0
trend= (mov != 0) and (mov != mov[1]) ? mov : nz(trend[1])
isTrending = rising(close, trendDetectionLength) or falling(close, trendDetectionLength) //abs(close-close[1]) >= dif
wave=(trend != nz(wave[1])) and isTrending ? trend : nz(wave[1])
vol=wave==wave[1] ? (nz(vol[1])+volume) : volume
up=wave == 1 ? vol : 0
dn=showDistributionBelowZero ? (wave == 1 ? 0 : wave == -1 ? -vol : vol) : (wave == 1 ? 0 : vol)
plot(up, style=histogram, color=green, linewidth=3)
plot(dn, style=histogram, color=red, linewidth=3)
============================================================================
ThinkScript:
declare lower;
declare zerobase;
input trendDetectionLength = 2;
def mov = If(close > close[1], 1, If(close < close[1], -1, 0));
def trend = If((mov != 0) and (mov != mov[1]), mov, (trend[1])) ;
def isTrending = IsAscending(close, trendDetectionLength) or IsDescending(close, trendDetectionLength);
def wave = If((trend != (wave[1])) and isTrending, trend , (wave[1]) );
def vol = If(wave == wave[1] , ((vol[1]) + volume) , volume ) ;
plot up = If(wave == 1 , vol , 0 );
plot dn = If(wave == 1, 0, If(wave == -1, vol, vol));
[login to view URL]([login to view URL]);
[login to view URL]([login to view URL]);
[login to view URL](3);
[login to view URL](3);
[login to view URL]([login to view URL]);
[login to view URL]([login to view URL]);
Project ID: 22842780
About the project 4 proposals
Remote project
Active 4 yrs ago
Looking to make some money? Email address Apply for similar jobs Benefits of bidding on Freelancer Set your budget and timeframe
It's free to sign up and bid on jobs
4 freelancers are bidding on average $36 USD for this job
hi.........................................................................................................................................................................
$20 USD in 3 days
5.0 (229 reviews) Hi,
I'm a software developer with focus on metatrader platform.
I've got many years experience both in trading and coding.
Programming languages - MQL4/5, AFL, PineScript.
$70 USD in 3 days
5.0 (57 reviews) I have now converted this script to thinkorswim on my side and it works well. can deliver shortly after I am selected for task.
$45 USD in 1 day
5.0 (4 reviews) Hi,
Id like to get this job. Let me try to conver this script.
Thx, Nick
$10 USD in 7 days
0.0 (0 reviews)