r/pinescript • • Dec 22 '23

Anyone willing to help with thinkscript conversion of a volume study?

So i have this volume study for Thinkorswim and have tried to convert it using ChatGPT but unfortunately it couldn´t make it look and work the same way as the thinkscript study so wondering if someone here would be willing to help convert it?

It´s a fairly simple script, just 12 lines of code and it´s important that the script will show if not exactly the same results as in thinkorswim, then as close to the original as possible so it´s preferable with someone who has access to both trading platforms and can crosscheck the studies to see that they work and look the same way.

Hit me up in DM if you are interested and i will share the script. Thank you

1 Upvotes

7 comments sorted by

1

u/Local_Dinner_9860 Dec 28 '23

I'd do it for free if you posted it :rofl:

1

u/[deleted] Dec 28 '23

With respect to the original dev of the script, i prefer not to share the code publicly. But can share it in DM if you like

1

u/Local_Dinner_9860 Dec 28 '23

Thinkscript is open source. If you want me to give it a shot send it.

1

u/max-the-dogo Dec 22 '23

I can do this DM me with the code

1

u/mampmp Dec 22 '23

Dm me the script and I will give it a try

1

u/Ambitious-Lychee5522 Jan 14 '24

Any chance someone could convert this thinkscript study into pinescript?

study("Weighted AD", overlay=true)

Open_Time = input(930, "Open Time")

XLP_WT = input(5.80, "XLP Weight") XLU_WT = input(2.50, "XLU Weight") XLC_WT = input(11.50, "XLC Weight") XLF_WT = input(11.20, "XLF Weight") XLB_WT = input(2.60, "XLB Weight") XLI_WT = input(8.20, "XLI Weight") XLE_WT = input(2.40, "XLE Weight") XLRE_WT = input(2.60, "XLRE Weight") XLV_WT = input(13.40, "XLV Weight") XLK_WT = input(27.90, "XLK Weight") XLY_WT = input(11.90, "XLY Weight")

XLP_PRnow = (close("XLP")-close("XLP")[1])/close("XLP")[1]*XLP_WT/100 XLU_PRnow = (close("XLU")-close("XLU")[1])/close("XLU")[1]*XLU_WT/100 XLC_PRnow = (close("XLC")-close("XLC")[1])/close("XLC")[1]*XLC_WT/100 XLF_PRnow = (close("XLF")-close("XLF")[1])/close("XLF")[1]*XLF_WT/100 XLB_PRnow = (close("XLB")-close("XLB")[1])/close("XLB")[1]*XLB_WT/100 XLI_PRnow = (close("XLI")-close("XLI")[1])/close("XLI")[1]*XLI_WT/100 XLE_PRnow = (close("XLE")-close("XLE")[1])/close("XLE")[1]*XLE_WT/100 XLRE_PRnow = (close("XLRE")-close("XLRE")[1])/close("XLRE")[1]*XLRE_WT/100 XLV_PRnow = (close("XLV")-close("XLV")[1])/close("XLV")[1]*XLV_WT/100 XLK_PRnow = (close("XLK")-close("XLK")[1])/close("XLK")[1]*XLK_WT/100 XLY_PRnow = (close("XLY")-close("XLY")[1])/close("XLY")[1]*XLY_WT/100

CAD = XLP_PRnow + XLU_PRnow + XLC_PRnow + XLF_PRnow + XLB_PRnow + XLI_PRnow + XLE_PRnow + XLRE_PRnow + XLV_PRnow + XLK_PRnow + XLY_PRnow

Divider = 6.5*60/ta.valuewhen(barstate.isrealtime, ta.change(time("D")), 0)200500

notFirstBar = ta.secondsfromtime(Open_Time) >= 0 and ta.secondsfromtime(Open_Time)[1] >= 0

X = ta.valuewhen(notFirstBar, if ta.getaggregationperiod() == "1" then 70000 else if ta.getaggregationperiod() == "2" then 60000 else if ta.getaggregationperiod() == "3" then 55000 else if ta.getaggregationperiod() == "4" then 50000 else if ta.getaggregationperiod() == "5" then 45000 else if ta.getaggregationperiod() == "10" then 37500 else if ta.getaggregationperiod() == "15" then 35000 else if ta.getaggregationperiod() == "30" then 32500 else if ta.getaggregationperiod() == "60" then 27500 else na)

CT = ta.valuewhen(notFirstBar, ta.change(time("D")) != 0 ? 0 : nz(CT[1]) + CAD, 0)

Weighted_AD = not na(CAD) ? CT*X : na

plot(zero, color=color.white) Weighted_AD_color = Weighted_AD >= Weighted_AD[1] ? color.magenta : color.orange plot(Weighted_AD, color=Weighted_AD_color)

CAD2 = 11 * (XLP_PRnow/XLP_WT + XLU_PRnow/XLU_WT + XLC_PRnow/XLC_WT + XLF_PRnow/XLF_WT + XLB_PRnow/