Hi Pete, Thanks for awesome tutorial on tos. It really shorten my learning curve considerably and make me comfortable with tos platform and scripting. As I recently started learning, maybe you have already answered this in your one of tutorials but I haven't caught up with all material. I have following script which is not working with sell CONTIONAL ORDERS. It is producing weird results wherein sometimes sell order triggers too quickly or it doesn't trigger sell order at all. Could you please tell me what I am missing here? I try to take tdameritrade help from tos platform. They were not much helpful saying script is too complicated. By the way, same script when used with Charts seems to be working fine. Script tries to achieve following. 1. Accumulate the difference of current close price to the previous bar close price until script remain active. I am expecting scripts executes once every 5mins as 5min is selected using conditional order dialog box. 2. Use accumulated difference to calculate original close price at the time of order placement by subtracting difference from current close price. 3. Compare current close price with above calculated original close price and use it for triggering order execution. ______________________________________________________ declare lower; def delta = close(period = aggregationPeriod.FIVE_MIN) - close(period = aggregationPeriod.FIVE_MIN)[1]; def deltaClose = deltaClose[1] + delta; def priceAtBuy = close(period = aggregationPeriod.FIVE_MIN) - deltaClose; def salePrice = close(period = aggregationPeriod.FIVE_MIN) * 1.05; plot signal = priceAtBuy < salePrice; _____________________________________________________ Few questions I have if you can shade some light. 1. How frequently scripts run. I am assuming it runs at periodicity selected with conditional dialogbox. In my case, every 5mins. Is this how it works? 2. What is start bar considered for a script used with conditional order? I was informed by tdameritrade chat support rep that in Chart study, it takes first visible bar on the screen as start bar for script calculation. I am not expecting same is true for conditional order. But, support rep does know how it works.