QuoteI understand it shifts at midnight. The problem here, if I understand correctly, is from 0000 to 0930 the daily close is (will be) that of 1600. During this period there’s no data if our main aggregation period is less than a day. Is it possible to replace the daily close during 0000 ~ 0930 with 1600[1] (previous day close)? I did. See example no. 2 above. That's exactly what it's doiby robert - Trading Discussion
Quotehowo3579 Instead of letting the close shift from previous day close to following day's close, how do we ask TOS to use the previous day close until 9:30am (9:00 for future) and then it can start actively return close live again? As before, daily close shifts at midnight. plot line = close(period = "day" ); line.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);by robert - Trading Discussion
Quotehowo3579 One thing I have problem with is 4 hour chart with after hour turn on. The plot is all jacked up and discontinuous and back test report only gave me a few trades even though I knew it should've triggered trade more frequently. I suspect this is due to comparing intra-day data (4 hour) with daily data during extended hours. I believe that doing so will result in erroneous data.by robert - Trading Discussion
QuoteRalph53 Robert, I posted this last week and I don't know if you answered it yet? This line script you gave me starts 10 candles back and works great. How can I add this description of it ' - 5 ' somewhere on the line (preferably at its beginning - 10th bar back) so I know what it is? Thanks so much. # 5 Cents Below Open # def OpenNeg5 = (open("period" = AggregationPerioby robert - Trading Discussion
QuoteKevinR Robert, First, I would like to thank you for this thread. I have learned a lot on thinkscripting from it. Thanks. Happy to have helped. QuoteKevinR I have a request which I have had trouble with: For any given indicator that features a discontinuous plot of up/down arrows, how would you make an additional plot that "connects the dots" (arrows) with straight lby robert - Trading Discussion
QuoteRalph53 Robert; is there any way to alter the line length of this script so it's 3 candles long? Thanks again. def Low10 = Low +.10; def lastbar = HighestAll(if IsNaN(close) then 5 else BarNumber()); plot condition = if BarNumber() < lastbar then GetValue(Low10, BarNumber() - lastbar) else Double.NaN; condition.SetLineWeight(1); input lineLength = 3; def Low10 = low + .1by robert - Trading Discussion
QuotePalmer Thanks my friend....I left out the word 'scan' after is it possible to .... Will do my best to 'take it from here'. Remember that a scan must have one and ONLY one plot. The "plot" will be the scan criteria. For example, if you had a chart with the 50 and 200 period moving averages and wanted to scan for when the 50 crossed above the 200 you would do it like thisby robert - Trading Discussion
QuoteTampman Robert: Thank you so much... but I forgot to ask for the CCI w/BB's... if you could provide that one too and it to the others it would great! Will await for that one to be added ..and will pay for all 6 when done..Thanks again!! You are awesome!! Done.by robert - Trading Discussion
QuotePalmer Thanks again. Previous indicator paid for itself yesterday " Congratulations on a good trade. I'm happy to hear that the indicator is working well. QuotePalmer Is it possibe to the previous day's 1 minute chart? I wan't to look at yesterdays 1 minute data from the market open through the first 15 minutes on a 1 min chart: Condition1 RSI(14) > 80 I can define theby robert - Trading Discussion
QuoteTampman Can you provide a TOS code for 5 indicator studies: RSI w/BB's; MFI w/BB's,.. %b(RSI);, %b(MFI); and %b(CCI).. BB setting at length 50 and Dev 2.1, 2.1 for all. Much appreciated... Jim I sure can.by robert - Trading Discussion
Quotehowo3579 I’m having trouble to sell close based on Tan’s strategy: ½ position when close is 2*ATR above entry price. ½ position when close is 5*ATR above entry price. ½ position when close is at entry price if it didn’t hit 5*ATR above. full position when close is 2*ATR below entry price. Full position or remaining ½ when no matter what when time is 1 min before market clby robert - Trading Discussion
Quoteaz I am using a script to display a label with price change of SPX on a daily chart, but I am not able to display the same price change of SPX on an intraday chart. It shows an error: "Two different secondary periods can't be used with one variable". I tried to change the aggregation period, but the error persists. All I am trying to do is to have a label that would display theby robert - Trading Discussion
Quotemtut Somehow the code got corrupted. I tried to paste the code again and the same thing happens. This forum has "automatic smiley" enabled. So anytime the message board encounters a quotation mark followed immediately by a close parenthesis it automatically converts that to a winking smiley. Like so... ") automatically becomes " To get around this when I post scby robert - Trading Discussion
Quoteraveon Robert I was thinking of buying one of the scripts from your Blog but had a question. I can't see any other way to reach you there or here. I have a similar script you wrote that I downloaded from here that is very good but I'm thinking the one on your Blog most likely has some differences. How can I get in touch with you? You can send me a PM on this board if you wish.by robert - Trading Discussion
howo3579 , My wife and I are in the process of packing the house in preparation for our move, so I don't really have time for any scripting right now. For your script, take a look at the FP/HRFP script on the first page of this thread for an example of combining several conditions into one signal. Take a look at my response to Palmer further up on this page explaining to him how to referenceby robert - Trading Discussion
Quoteoptiontrader101 is it possible to make a protection of a special indicator ? So any one can use it but no one can see the code ? Sadly, no. I would have done this long ago if I had been able to.by robert - Trading Discussion
QuotePalmer if you happen to be a CodingGeek or ComputerGeek or some other kind of Geek PM that to me along with your address and I'll cut you a few "_____ Geek" decals and get them to you. If you don't see the correct phrase just send that to me and I'll put that together no problem. That's pretty nifty. I'm in the process of packing for a move, but will take you up on your kind oby robert - Trading Discussion
Quotelinter is there a way to configure it so that i get a blue reading if slowd<20 or if slowd has crossed above 20 in the last two days (or a user set number)? Change the value of last_N_days as required. input last_N_days = 2; def SlowD = StochasticFull(80, 20, 5, 1, HIGH, LOW, close, 3, "SIMPLE" ).FullK; def SlowBelow = SlowD < 20; def SlowCrosses = SlowD crosseby robert - Trading Discussion
Palmer, ok...ok...I'm finally up to speed. When I originally answered you last night, I thought that the code you presented was only a portion of your larger script and assumed that all the variables had been defined earlier. So, I suggested that you needed to check for momentum crossing below momentumSMA. I didn't realize that you were referencing pre-defined studies. ( I did mention thby robert - Trading Discussion
QuoteRalph53 How can I have the price bubble from the price area appear on a chart in a fixed spot? Say 8 candles to the left and dead center in height? I would need to know how to alter the coordinates if I need to move it. def X = HullMovingAvg() - HullMovingAvg()[1] Why not just put it in a box at the top? def X = HullMovingAvg() - HullMovingAvg()[1]; AddLabel(yes, "X: &by robert - Trading Discussion
Quotekadosh I need to modify the following section to correctly define the previous day's close def CloseYesterday = close(period = AggregationPeriod.DAY)[1]; Quotekadosh I need to modify the following section in order to correctly define the current day's open def OpenToday = open(period = AggregationPeriod.DAY);by robert - Trading Discussion
QuotePalmer The logic I am trying to code is when both the Momentum and its SMA are above the zero line and the Momentum has dipped below the SMA such as i nthis example: Gotcha. Change condition 4 to this: def condition4 = if reference Momentum(15) crosses below MomentumSMA(15) then 1 else 0;by robert - Trading Discussion
Palmer, I don't have TOS loaded up at the moment, but looking over your code, this line stands out: def condition4 = if reference Momentum(15) < MomentumSMA(15) then 1 else 0; As you've defined it, Momentum(15) will never be less than itself so this line will always evaluate as false. I am assuming that you meant to say that momentum is less than the previous momentum in which caseby robert - Trading Discussion
You need to use the SetHiding() function, but it seems to be broken right now because not even the examples that are given on the thinkorswim website work anymore.by robert - Trading Discussion
QuoteRalph53 I didn't describe this right. I wanted to place the line on the left side of the chart. On a 15 candle chart it would start on the 10th candle from the right and work left from there. I find that to many horizontal lines on a chart become a distraction and it would view better if some were on the left. # 5 Cents Below Open # def OpenNeg5 = (open("period" = Aggreby robert - Trading Discussion
QuoteRalph53 I plot this script as a line on a chart; # 5 Cents Below Open # def OpenNeg5 = (open("period" = AggregationPeriod.DAY) -.05); plot condition = OpenNeg5; Does anyone know of a way to re-script it so the line starts 10 candles behind the current candle? Thanks. # 5 Cents Below Open # def OpenNeg5 = (open("period" = AggregationPeriod.DAY) - .by robert - Trading Discussion
Quotenetarchitech Off topic...what screen capture utility are you are currently using? I'm guessing Techsmith's SnagIt. If so, would you recommend it? You've a good eye for detail. That is exactly the program I am using. Hardly a day goes by that I don't use it. I also like to use ScreenSnapzProX. Yes, I would recommend SnagIt. I like how easily annotations can be added to a screenshot.by robert - Trading Discussion
Bijinkei, This is what I came up with as an alert script. No recursive variables are used. I tested it on a 1 minute chart (just so I wouldn't have to wait as long) and it seemed to work. This is only the alert for crossing the upper band. I leave the lower band to you. input length = 55; input lookback = 2; input lookforward = 1; def HP = high > Highest(high[1], lookback);by robert - Trading Discussion
Quotebijinkei I tried replacing a bunch of things with GetValue and while the plot works, the study alerts still give me that rec usage not allowed message. I think the issue is that I'm still using < and >? Post your original script (the one with the recursive variables). Also, tell me how you want the alerts to work. I'll take a look and see if something can be worked out.by robert - Trading Discussion