Converting Pinescript (TradingView) indicator to thinkscript (ToS) $10-30 USD Pubblicato più di 4 anni fa
$10-30 USD Pagato al completamento
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]);
Rif. progetto: 22842780
Info sul progetto 4 proposte
Progetto a distanza
Attivo 4 anni fa
Hai voglia di guadagnare un po'? Indirizzo Email Candidati per lavori simili I vantaggi delle offerte su Freelancer Imposta il tuo budget e le scadenze
Fatti pagare per il lavoro svolto
La registrazione e le offerte sui lavori sono gratuite
4 freelance hanno fatto un'offerta media di $36 USD
hi.........................................................................................................................................................................
$20 USD in 3 giorni
5,0 (229 valutazioni) 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 giorni
5,0 (57 valutazioni) 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 giorno
5,0 (4 valutazioni) Hi,
Id like to get this job. Let me try to conver this script.
Thx, Nick
$10 USD in 7 giorni
0,0 (0 valutazioni)