♥ 0 |
I have this code so far: declare lower; input symbol1 = “/GC”; plot smb1 = close(symbol1); This plots the standard gold futures contract. I want to plot specific gold contracts with different expirations, namely 6 months and 12 months out until expiration. Instead of writing out each contract manually, i.e. “/GCU22”, is there a way to automate the process by using a code like this: declare lower; def yearv = GetYear() – 2000 + 1 def monthproxy = GetMonth(); #montharray = {F,G,H…. , Z}; if monthproxy == 1 then monthv == F; if monthproxy == 2 then monthv == G; etc.# input symbol1 = “/GC” + monthv + yearv; plot smb1 = close(symbol1″;
The part inside ## is not thinkscript conform as I’m not quite sure how to create that motharray that let’s me pick out the correct month letter for the futures contract. I basically want to go from this: “/GC” to “/GCM22” automatically by using the getyear and getmonth functions. So far, I just can’t concat the different variables and the “/GC” string
Marked as spam
|
Please log in to post questions.