How to put Daily Ichimoku levels on a 1-minute chart: I use the 7-22-44 calculations. input agg = AggregationPeriod.DAY; input h = FundamentalType.HIGH; input l = FundamentalType.LOW; input tPeriod = 7; def htenkan = highest(Fundamental(h, period = agg), tPeriod); def ltenkan = lowest(Fundamental(l, period = agg), tPeriod); plot tenkan = (htenkan+ltenkan)/2; input kPeriod=22;by mangomick - Trading Discussion
Ah well, think it may just be this: def GreenCandle = Close>Close[1] and barnumber()>=1; def RedCandle = Close<Close[1] and barnumber()>=1; def UpVolume = if GreenCandle then Volume else 0; def GreenVolume = SUM(UpVolume, 390); def DownVolume = if RedCandle then Volume else 0; def RedVolume = SUM(DownVolume, 390); Plot ratio = GreenVolume[0]/RedVolume[0]-1; Enough alreadby mangomick - Trading Discussion
Hey, must have been the almond chocolates, I finally got a boost of brain cells, I think! def relevantcandle = barnumber()>=1; def relevantvolume = if relevantcandle then volume else 0; def sumvolume = sum(relevantvolume,390); plot dot = volume/(sumvolume/barnumber())-1; Seemed to work.... let's see.... If yes, then I just need to apply this somehow to the red candle green candle forby mangomick - Trading Discussion
Hello again, I came up with a rather blunt solution, but now I am getting the following error: "com.devexperts.tos.thinkscript.runtime.TooComplexException: The complexity of the expression suggests it may not be reliable with real-time data.” Here is my inelegant code below. Would greatly appreciate any advice on how to make this a lot simpler! def value = if(secondstilltime(093by mangomick - Trading Discussion
OK! Per my earlier post, I have determined that I am definitely referencing yesterday's bars! So, Question #1 has been answered (by myself). As for question #2, it is a burning question that will make my life a whole lot easier if a kind person could please let me know? Here is a simpler code that I wish to calculate using only today's bars: plot Data = volume[1]/average(volume,390)-1;by mangomick - Trading Discussion
Hello! These are questions from a total newbie! 1. Does the code below automatically start at the beginning of the day, or does it consider the 389 bars from yesterday when calculating the first minute ratio? def GreenCandle = Close>Close[1]; def RedCandle = Close<Close[1]; def UpVolume = if GreenCandle then Volume else 0; def GreenVolume = SUM(UpVolume, 390); def DownVolume = ifby mangomick - Trading Discussion