♥ 0 |
Good morning Hahn, Hope all is well. I was wondering if you could help me out or lead me in the right direction. In ToS Scan, I would like to have a scan alert that I could set to my phone for the following situation. For example, If RSI signals Oversold 2 or more times within the following 5 bars, then the Moving Average (9) crosses above the Moving Average (18), send an alert text/plot arrow up I would like to be able to adjust the following inputs above: RSI Oversold RSI Overbought min number of times = 2 (shown in example) length of time for the signal = 5 (shown in example) moving avg. #1 = 9 (shown in example) moving avg. #2 = (shown in example)
Thanks, Robin Hood
Marked as spam
|
Please log in to post questions.
Hey Hahn,
I added the following code below to the end of the scan in order to see where the price is when the trigger hit, but my charts aren’t showing anything. Any help?
scan.SetDefaultColor(Color.ORANGE);
scan.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
The two conditions you have specified for a signal should be extremely rare. You have two RSI crosses of the oversold inside of 5 bars, combined with a crossing of two moving averages. I am not surprised you cannot find any signals. If you have an example (ticker symbol and time frame) I will take a look. But I think the most helpful method would be for you to debug your conditions by separating them and plotting them individually:
plot condition1 = sumOfOversold >= oversoldHits ;
plot condition2 = ma1[1] < ma2[1] and ma1 > ma2;
For example (AAPL / Daily / 11-28-16), using this technique I found both conditions align for a combined signal ONLY AFTER reducing oversoldHits to 1 and increasing signalLength to 10.
Hey Hahn,
If I wanted to add an autobuy for when my ”scan > value:1” (shown above: plot scan = trigger) in my strategy, how would it look like?
Thanks again!
in general, the code required in the scan engine is identical to the code required to create Study Alerts and Conditional Orders. So as long as it works in the scan you should give it a try in the Study Alert, to test it first. There are some limitations that may prevent the code from working but I have not taken the time to test it or look for potential issues.
Hi Pete,
I’ve tried multiple variations of the autobuy below, but there isn’t activity showing in my P/L strategy.
AddOrder(OrderType.BUY_AUTO, scan, open, tradeSize, Color.BLUE, Color.LIGHT_GREEN);
AddOrder(OrderType.BUY_AUTO, trigger, open, tradeSize, Color.BLUE, Color.LIGHT_GREEN);
For your reference, the scan works in SCAN tab when I put ”SCAN is greater than (VALUE): 0”
A strategy requires both buys and sells. You only have one side of the strategy there. Both AddOrder statements are set to BUY_AUTO. You need an opposing signal and use that with an AddOrder statement set to SELL_AUTO. You may want to go back and watch our strategy videos again. We also have a video demonstrating how to convert between scans and strategies. https://www.hahn-tech.com/thinkorswim-scan-to-strategy/
Thanks for the tidbit. Must have missed that key detail that a strategy needs a buy & sell auto. Enjoy the donations for your troubles.
Thank you, that was very generous. Very much appreciated.