"$d_web"'CompLangs/PineScript/Kivanc Ozbilgics Turtle Trade PineScript - documention.txt" www.BillHowell.ca 20Dec2020 initial 08******08 20Mar2021 https://www.tradingview.com/chart/kfkUtvGu/ This is my first attempt at PineScript coding. It doesn't quite do what I would like, but it mostly works. The intent is to : - learn PineScript at a basic level. I don't want to become an expert, but it is handy. v- use this chart along with my second PineScript program, https://www.tradingview.com/chart/olC6bR38/, which shows aspecial detrended view FX-SPX500 along with the same other markets. - provide a basis for further modeling of the relationships between the markets, including the effect of some exogenous variables if I ever get around that - provide the script publicly - it may be handy for other beginners, or others may want to take the approach further. This chart of FX-SPX500 makes use of an 83 year semi-log DETRENDED series (1926-2020), for which "relevant" log(Fibonacci(y/y_Trend)) lines appear as long-term reference levels for current market behaviour. "relevant" log(Fibonacci(y/y_Trend)) lines are based on [min,max] values for the entire "approximate visible bar_index length" in the viewing window, whether [1D,5D,1M,3M,6M,1Y,5Y,All]. The [min,max] values also control the portion of the verticle scale that FX-SPX500 occupies (see "Current problems" section below). The "relevant" log(Fibonacci(y/y_Trend)) lines are selected from the Fibonacci reference levels [0.055728, 0.090170, 0.145898, 0.236072, 0.381971, 0.500000, 0.618047, 0.786164, 1.000000, 1.272000, 1.618000, 2.000000, 2.618000, 4.236000, 6.854100, 11.09020, 17.94430] where these lie between [min,max]. These are shown in gray, with indicator levelshowing the respecve Fibonacci levels. The exceptional color is orange for a Fib level of 1.000. The detrending process is described (with background software) on my website : SP500 log detrended 1926-2020 = 10^(0.792392+0.0289587*(year_fraction - 1926.25)) http://www.billhowell.ca/economics,%20markets/SP500/multi-fractal/1872-2020%20SP500%20index,%20ratio%20of%20opening%20price%20to%20semi-log%20detrended%20price.html I found it frustrating this week while getting used to PineScript as a beginner, as many simply things have to be approached differently from conventional tools like [gnuplot, bash, QNial, C, gimp, etc]. However, I must say that TradingView PineScript is very well thought out for its purposes, the code is incredibly [simple, compact, powerful], and it really is a wonderful tool! But you knew that already. www.BillHowell.ca +-----+ Label the "Fibonnacci mirror trendlines" for calculated series : Simply done by : right-click on Price Menu of interest -> labels -check : Indicator [label name, last value] label +-----+ 20Mar2021 Current problems with the script : - The intent was to calculate [min,max] values on the basis of the "approximate visible bar_index length" in the viewing window, whether [1D,5D,1M,3M,6M,1Y,5Y,All], but this isn't working properly so these are not shown at present. Unfortunately, my current code isn't satisfactory, so the [min (red), max (green)] levels (no longer shown) do NOT perly correspond to the "visible bar_index length". - The chart assumes that FX-SPX500 is the primary symbol, but perhaps I should make that explicit? - I haven't yet posted all of this on my website with explanations, and links to other market-related analysis. # enddoc