♥ 0 |
Hi, I’m having grief building a conditional order to sell when RSI of daily aggregation > 55. input RSIlength = 4; def price = close; def NetChgAvg = MovingAverage(RSIavg, price – price[1], RSIlength); plot SELLINGsignal = RSI > exitScore; # —————————————————————————— However, the trading rule says “ON THE CLOSE”. MOC orders don’t allow conditions. So, I’m trying to use MARKET with conditions. And, this will work for that part of the puzzle: input marketCloseTime = 1600; def secondsTillClose = SecondsTillTime(marketCloseTime); plot SELLINGsignal = TIME_OK; # ————————————————————————————- However, THAT hast to run on an aggregation period smaller than DAY, or it won’t work. So, I’m down to trying to get the DAILY level RSI in a sub-day-level aggregation period. If I use this (screen shot 1): def price = close(period = AggregationPeriod.DAY); I won’t get TODAY’s RSI score until actual CLOSE of the daily bar – which means we can’t trade based on the information. (And, GTC Extended can’t use conditions, either). It appears the puzzle is about calculating DAILY period RSI, but within a sub-daily aggregation period. I tried this experiment (on a one-hour chart): declare lower; input crStartTime = 1500; def CR = if SecondsFromTime(crStartTime) > 0 and SecondsFromTime(crEndTime) <= 0 plot line = CR; plot day = close(period = aggregationperiod.DAY); On the one-hour chart, the lines are not exactly the same, but the values at close-of-day are identical However, if I use this CR value to calculate RSI, everything goes off the rails (screen shot 2): declare lower; input length = 4; input crStartTime = 1500; def day = close(period = AggregationPeriod.DAY); def dNetChgAvg = MovingAverage(averageType, day – day[1], length); plot dRSI = 50 * (dChgRatio + 1); def CR = if SecondsFromTime(crStartTime) > 0 and SecondsFromTime(crEndTime) <= 0 def crNetChgAvg = MovingAverage(averageType, CR – CR[1], length); plot crRSI = 50 * (crChgRatio + 1); # ————————————————————————————————————– I’ve got a second-level issue in that I’d like to limit this thing also to trading only on the last trading day of the week, and I’d like not to miss a trade due to a holiday (Thursday LDOW rather than Friday). But, at this point, that’s secondary to the main puzzle. Any help would be appreciated!
Marked as spam
|
Please log in to post questions.
Hi, Pete,
Thanks very much for your answer.
I’m sorry I didn’t mention trying the solution you suggest. It’s very simple and straightforward.
The problem with it is that it’s specific to a given date. In other words, the entire order – study and all – has to be re-input and the trigger time re-set for the next day … EVERY SINGLE DAY.
I often travel for days or even weeks at a time, during which I’m sometimes unable to get an Internet connection. Also, as you are probably also painfully aware as I am – EVERY iteration of order entry is another opportunity for making a costly mistake.
So, I’m looking for a solution that will allow me to set (and triple-check) the market conditions and time to execute and then leave it until I receive a notice that it’s executed – and I can then input the reverse order to let it go again.
I remain hopeful that there is such a solution to be had – not only for END OF DAY, but also for END OF WEEK.
Thanks again for any feedback!
Given these added details I can tell you that Thinkorswim is not even close to the technology you need. You need institutional level technology to get there. You need to have a fully automated trade system that runs on a server. This narrows the list of options significantly.
About the only platform I know of that can handle the requirements without being prohibitively expensive is Interactive Brokers. But you will need to hire a developer to build your automated trading system. (not me)
However the massively lower commissions from IB should more than redeem developer expense over time. Just depends how serious you are about this, and how much capital you are committing to this sort of trade setup.