QuoteNeoisback could it not all be done in one script, and show in just one column? Do the calculation in one script, and then plot the % result in one single column? Unfortunately not, because the scripts for columns need to specify only one working time (yellow arrow), so your internal script in multi-times wouldn't workby rigel - Trading Discussion
Netarchitec Look for the help of Fold statement, and see the examples. Your fold instruction has two problems: It has incorrect syntax and anyway, you are not using the variable data in the rest of your calculation. What is the name of the indicator you are trying to convert ? is there a link to the formula?by rigel - Trading Discussion
Neoisback To change the color of the values add this at the end: use the colors you like most simple.assignValueColor(if trendup then color.black else color.white ); For your second question, each of those columns would be independent, so there is no way to check across columns to assign the score you likeby rigel - Trading Discussion
For your first question, try this #200SMA price Column plot simple = simpleMovingAvg(close,200); def trendup = simple > simple[1]; AssignBackgroundColor(if trendup then Color.UPTICK else Color.DOWNTICK); I don't quite understand your second questionby rigel - Trading Discussion
netarchitech try this # Convertion of Tradestation ELS into Thinkscript # By Rigel , Jan 2019 declare lower; input Length = 20; def srsi=(fold K=0 to length-1 with srsim=0 do (if absvalue(high - low)==0 then 0 else absvalue(close - open)/ absvalue(high - low))+srsim)/Length; plot line1 = 0.38; line1.SetDefaultColor(Color.DARK_RED); line1.HideTitle(); line1.HideBubble();by rigel - Trading Discussion
Any indicator that "works" with future candles is a re-paint type, therefore their signals are unreliable. Shouldn't be nice to know the future? If you add, using AND, "future" conditions to past conditions obviously you will not get any signals as the test of future candles will be false. In other words, ask yourself, what is the program to tell you to the question: is toby rigel - Trading Discussion
Sumihiko I understand you are learning TOS scripting... so a piece of general advice: try to define your conditions one by one to help in your thought process: input price=close; declare upper; plot SLOPE = 2*close[3] - close[9]; def Cond1= price>slope; def Cond2= price>slope[1]; def Cond3= price>slope[2]; def Cond4= price>slope[3]; #slope will be greeby rigel - Trading Discussion
Pilotui You only need to delete the declaration: declare lower; But you will not see the study as you like it. The reason is that you will have conflicting units: the price of the symbol you are looking at, and the units of your indicator which are completely different.by rigel - Trading Discussion
Hi sumihiko Try this: input price = close; input length = 9; input displace = 0; input averageType = AverageType.SIMPLE; input ATRperiod = 9; declare lower; def ATR = MovingAverage(averageType, TrueRange(high, close, low), ATRperiod); addlabel(yes,"atr :"+atr,color.yellow); def avg = MovingAverage(averageType, price, length); addlabel(yes,"avg :"+avg,color.whiby rigel - Trading Discussion
mpetry, is this what you are talking about? QuoteThe Balance of Power indicator measures the market strength of buyers against sellers by assessing the ability of each side to drive prices to an extreme level. The calculation is: Balance of Power = (Close price – Open price) / (High price – Low price) The resulting value can be smoothed by a moving average. That sudy is already availablby rigel - Trading Discussion
QuoteHawkeye ok so, how can i add an "any symbol" input Please read my answer to F1p 0pt10ns, in this page, about getting IWM in any other symbol chart or my other post hereby rigel - Trading Discussion
Quotedyannantuonojr I have not been able to parse this study and have it only declare the labels ... What do you mean? did you copy that code with those winking smiles and you have errors? it works well for me.by rigel - Trading Discussion
QuoteF1p 0pt10ns I am trying to get labels on every one of my charts that shows the current IWM price and colors it green if IWM is greater than IWM's close You were very close, replace your add labels with these: AddLabel(IWM > close("IWM","DAY" )[1], "IWM: " + IWM, Color.GREEN); AddLabel(IWM < close("IWM","DAY" )[1], "IWMby rigel - Trading Discussion
Hawkeye Not sure what you try to achieve plotting one horizontal line with a very low value (e.g 0.81%) rather than write it in a label See my post here to see if it gives you ideasby rigel - Trading Discussion
Quote F1p 0pt10ns "Can anyone help me with this code? I am getting two different values for the opening 5 min range and the \"entry\" line on the 5 min and 2 min charts" You didn't say what the problem actually is. I imagine that you see in some charts that the range shown, varies depending on the chart time frame (5 min. vs 2 min)... If that is the case, there is notby rigel - Trading Discussion
brazilianpillar Do you want to have the plots for the last 3 days for example, rather than the last gap?by rigel - Trading Discussion
Kris See my answer above to Option master, adapt to your case which is simpler.by rigel - Trading Discussion
QuoteSim_Boy If someone could convert it to TOS that would be excellent! Try this: #// #// @author LazyBear #// #// If you use this code in its orignal/modified form, do drop me a note. #// #study("Volume Price Confirmation Indicator ", shorttitle="VPCI_LB" ) # Converted to TOS by Rigel 2018. # declare lower; input shortTerm = 5; input longTerm = 20; defby rigel - Trading Discussion
OptionMaster, Here you have it input length = 13; input paintBars = yes; def EMA = ExpAverage(close, length); def MACD = ExpAverage(close, 12) - ExpAverage(close, 26); def MACDHist = MACD - ExpAverage(MACD, 9); def GreenPrice = EMA > EMA[1] and MACDHist > MACDHist[1]; def RedPrice = EMA < EMA[1] and MACDHist < MACDHist[1]; Plot scan=close; assignBackgroundColor(ifby rigel - Trading Discussion
Ojano Try this: # Plot the high and low of X days ago # Don't know the author of original code to give proper credit # Basic code modified to produce similar results to Robert Payne's solution # by Rigel April 2018 # declare upper; input LastBubble = No; Input DaysAgo = 1;#hint DaysAgo: Excludes today def AdjDaysAgo = DaysAgo + 1;#Adjusted to match a true LastDate which includesby rigel - Trading Discussion
Alexquate It means that the indicator is modifying the last signal constantly (the most recent). That is, you will see the point and in the next bar could change. In your case the last bar will be looking the past 10 bars to see if the current high is greater than the previous 10, that is fine, BUT will also look for the next 10 bars, that of course hasn't happened yet. In other words theby rigel - Trading Discussion
Alexquate That indicator "look into the future" for 10 bars.. (it is a re-paint indicator), what would be the usefulness of that?by rigel - Trading Discussion
Quotechillc15 Close is above MA1 and MA1 is above MA2 and MA2 is above MA3 color.GREEN and then obviously the reverse and then yellow when conditions have not been met. You could do that all in one go, but it helps, when learning, to do it in several steps. In this case define your conditions and at the end use them in the AssignPriceColor For example your condition for green is: def uby rigel - Trading Discussion
QuoteMoneyBags I wanted to know if you can add a 14 Exponential moving average to the lower study On Balance Volume indicator you created. Add these lines at the end. That should keep you going for the rest of the code plot ema14=expAverage(obv_osc,14); ema14.SetDefaultColor(color.white);by rigel - Trading Discussion
QuoteMoneyBags I am having a hard time creating a scan from the code below you created to let me know what stocks have a Green signal and another scan for stocks with a Red signal Hmm.. the zigzag is a re-paint indicator, so you will need to be scanning continuously and the signal can be changing... no point.by rigel - Trading Discussion
chillic15 Below a one min chart with an Alma 9 period in blue(1 min time frame) and another Alma 9 period in yellow (5 min time frame) You need to deploy two times the Alma study selecting the appropriated settings and colors # Alma MA with multiple time frames # in the settings "current" represents the current time frame of the chart # by Rigel, August 2018 # scriptby rigel - Trading Discussion
Quotechillic15 I should of been more clear on my first post. Yes.... So... what you want is ONE alma that has the capability to use the time frame of the current chart OR other HIGHER (*) time frame, right? If yes, please be specific: you use for example 5 min and want to be able to choose 15, 20,30,60,120 (*) TOS only allows to have equal or higher time frames that the current charby rigel - Trading Discussion
Quotechillic15 Below is a script for the ALMA and seeing if anyone can convert it from meta to TOS. No need to convert it, a fellow coder posted the Alma some years ago script ALMA { input Data = close; input Window = 9; input Sigma = 6; input Offset = 0.85; def m = (Offset * (Window - 1)); def s = Window/Sigma; def SumVectorData = fold y = 0 to Window with WS do WSby rigel - Trading Discussion
QuoteNMR I've started with this- but am at a loss to figure out how I put in the angle- I was thinking of only 5 or 10 angles worth of a move: A fellow coder once posted this, please check if this is what you need for your scan #hint: Plots the tangent angle of the inputted average declare lower; input length = 9;#hint length:The number agg-bars of the average input price = close;#hby rigel - Trading Discussion