Styx This code should do that # Rigel, May 2018 # declare lower; input Sym2 = "SPY"; def c2 = close(symbol = Sym2); def ma3=average(c2,3); def ma35=average(c2,35); plot Dots = (HighestAll(high) + LowestAll(low)) / 2; Dots.SetStyle(Curve.POINTS); Dots.SetLineWeight(5); Dots.AssignValueColor(if ma3 > ma35 then Color.GREEN else Color.RED);by rigel - Trading Discussion
QuoteParas Is that possible combine 3 tick based bars and make 1 bar Tick based bar. (Like three 5 minutes candle chart = one 15 minutes candle Chart) As explained before, the problem I see is to plot a big candle in the space occupied for 3 minor candles, in other words how to make a wide candle. As far as I am aware, there is not a native function that can plot those candles. What youby rigel - Trading Discussion
Paras Was playing a bit with the charts and while it is very easy to do and aggregation as you require, at the end you will need to plot the candles (overlay) and that is where TOS does not help anymore. To do the plot it would be necessary to use the function addchart that was deprecated as explained by Robert here Not only is a problem of colors but more importantly to cover 3 candlestby rigel - Trading Discussion
Let's try to clarify your wishes QuoteGoldenPineapple Would be cool to be able to have it start at market open and end at market close, save then reset every market day. Repeat. Don't see the point of doing that, your base value is 272 every single day, so all the lines will be in the same position every day regardless of market time. What does it mean save and reset in that context? Iby rigel - Trading Discussion
Mobile your code has conflicting instructions. This will plot very high numbers in the same scale of the stock chart... PLOT FI = ExpAverage((close - close[1]) *volume, lengthFORCE); and then, you are asking to plot negative values (-25) but only when FI is positive.... Do you notice that any color statement for FI negative values will never be executed? plot F_I = if FI >= 0by rigel - Trading Discussion
Paras Don't know if Robert is around neither if is possible to do what you want, but from a code perspective it is interesting, I will have a look at it.by rigel - Trading Discussion
Mobile Thanks for posting. Your code has many lines not used therefore the performance of your script will not be optimal. Not sure what you try to achieve. What does the meter indicate? Below is a cleaned version of your code. Notice that your switch statement can be re-written because your labels are show only when user selects Right (==2), so no need to make a switch. #MTF_ADX_METEby rigel - Trading Discussion
Earnings trader That code is incomplete (surely is part of a bigger script). Actually you can eliminate many lines there not affecting the pivots plotted. I'd suggest to (find) post the original code and work from there.by rigel - Trading Discussion
QuoteOtionMaster Tries using your indictor but won't work, some thing missing Weird, it works perfectly for me. PS: I will not work further on this.by rigel - Trading Discussion
Quoteoptionmaster ok is there a way to change the lines to bubbles that say buy, instead of the lines Replace the addchartline with: AddChartBubble(showBubbleschange and !IsNaN("ZZ$" ) and barNumber != 1, if isUp then high else low , "buy" , if barCount == barNumber or !isConf then GlobalColor("Unconfirmed" ) else if isUp then GlobalColor("Down" ) elsby rigel - Trading Discussion
That's weird, it works for me Are you sure you have showBubbleschange = yes ??by rigel - Trading Discussion
Quoteoptionmaster is there a way to have BUY CALL AND BUY PUT vertical lines on chart when zigzag forms a new trend. Color RED for BUY PUTS. Color Green for BUY CALLS. Replace your final AddChartBubble with: AddVerticalLine(showBubbleschange and !IsNaN("ZZ$" ) and barNumber != 1, "Buy", if barCount == barNumber or !isConf then GlobalColor("Unconfirmed" ) elby rigel - Trading Discussion
Snaggs I gave a quick look and your indicator should be working fine IF you are not showing after hours. TOS make the calculations with all the bars displayed, so if you have after hours displayed, the opening time and the closing time are NOT the same as regular trading hours. Therefore and expression like close[1] will be giving you the bar close at 8 pm EST instead of 4 pm. If you needby rigel - Trading Discussion
MOBILE Wrote: ------------------------------------------------------- Quote ok, i checked and what is needed is to be able to plot a 5min ADX on a one min time frame, is that possible? Create this indicator ADX5min and use in your 1 min chart declare lower; input length = 14; input averageType = AverageType.WILDERS; def agg= aggregationperiod.fIVE_MIN; def hiDiff = high(period=by rigel - Trading Discussion
Taz I am assuming you know how to create the custom columns.... You will need to create one for each time frame with exactly the same code (obviously each one should have different name) BUT paying attention to select the right aggregation time in the drop box of the custom list definition. Paste this code in every list input cutoffLength = 20; def whiteNoise = (close - close[2])by rigel - Trading Discussion
ARich1 Wrote: ------------------------------------------------------- Quote I am looking for code that will tell me whether or not the 50 day Simple Moving Average is sloped positive or negative, or pointing up or down. You didn't say how do you expect to be notified.... A common "standard" would be color code: green=up, red=down. If that, is what you are looking for, thby rigel - Trading Discussion
Mobile Happy that worked. Could you be more specific in your question? an average is an average... Your BullishTrend is simply PLOT BullishTrend = DIBull >= DIBear ; Those are DIPlus and DIminus.... so do you see my problem? what does that have to do with an average?by rigel - Trading Discussion
OptionMaster Add at the end of your code AssignPriceColor(if CPSqueeze < SqueezeRatio or Crosses(CPSqueeze,SqueezeRatio,CrossingDirection.ANY) then if Crosses (CPSqueeze,SqueezeRatio,CrossingDirection.ANY) then Color.yellow else Chop.Color("InChop" ) else color.CURRENT); Notice that I changed the color Green by yellow because otherwise would be difficult to differentiate inby rigel - Trading Discussion
Mobile If you don't need the rest of the code, why to include it? Anyway, add this to see if we get closer to what you want ####################### plot Dots = (HighestAll(high) + LowestAll(low)) / 2; Dots.SetStyle(Curve.POINTS); Dots.SetLineWeight(5); Dots.AssignValueColor(if !BullishTrend then color.green else color.red); #######################by rigel - Trading Discussion
OptionMaster Wrote: ------------------------------------------------------- Quote Is there a way to make a indicator for chop that would show up as candle colors Yes, there is. Post your indicator and I'll let you know what to addby rigel - Trading Discussion
Mobile the request is not clear. The label you are indicating changes the color depending on BullishTrend. We could work with that but then the rest of your code seems wrong because the plots of BullishTrend and X are never show (due to a difference of scale between their values and the stock price you are considering). You could see X if you add: declare lower; to your code. So the firstby rigel - Trading Discussion
Jalea the "script" reserved word acts as a function as you already know and it is possible to reference a study (like the projection) from another study (that possibly is what you mean), but I need you to show me what you want (article I can read, pseudo code, formula, excel spreadsheet or maybe in another programming language?) as it is not clear to me what would be the convolutionby rigel - Trading Discussion
wichitawx I don't have Robert's code but I modified some basic code found in Internet (no author to give credit for) which produces what you are looking for # 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; inby rigel - Trading Discussion
mikew Wrote: ------------------------------------------------------- Quotemikew rigel - Thanks for trying but unfortunately the scan is still starting the hourly candle at 9:00am instead of 9:30am. I think I'm going to have to use a 30 minute time frame and figure out how get it from there. I'll be sure to post my findings if I find a solution. Oh! now I got what you meant....by rigel - Trading Discussion
jalea148 If I close your script with "{ " and then replace inertia by LeavittProjection I don't get an error but this plot If that is what you are looking for then you only forgot to close the script.by rigel - Trading Discussion
mikew, try this... didn't have the time to test it though. def Begin = 0930; def Active = if SecondsFromTime(Begin) > 0 then 1 else 0; def inside_bar = high[1] <=high[2] and low[1] >= low[2]; plot s = Active == 1 and inside == 1;by rigel - Trading Discussion
mikew It seems to work well, are u sure you have selected the 1 hour time in the inputs below? Am I missing something in your question? What time zone are u using in your settings ? New York (Eastern Standard time)?by rigel - Trading Discussion
Mobil, I already indicated it in my reply how to referece 5 min in your studies. Try it. If that is no what you are trying to do, then please post your code and explain what is not working. When you say ADX study, that is already available in TOS. When you change the chart to 5 min, the study changes accordingly. So again, explain in more detail what you want.by rigel - Trading Discussion
Hi Mobile You are not explaining at all what your problem is or what you want to do... but I guess from the title that you would like to have the indicator working with 5 min charts... is that right? Then: def adx_length=12; plot ADX = wildersAverage(CLOSE(period = AggregationPeriod.FIVE_MIN), adx_length); please notice that wildersaverage needs 2 parameters not 3 Is that what you waby rigel - Trading Discussion
Thank Devil Your script is giving, as you say, the first bar but not necessarily always happens that, it could be the highest 5 min volumen is the third or any other bar in the interval mentioned. Rby rigel - Trading Discussion