OPEN-SOURCE SCRIPT

Bull Call Spread Entry Strategy

This strategy script uses the "Spread Entry Strength" overlay indicator script I designed to show entry timing optimized for an Option Bull
Call Spread.

As for this strategy...

The defaults for the strategy itself are as follows:
  • Period for strategy: 1/1/18 to 12/1/2021. This can be changed to a different period using the settings.
  • Condition for entry:
    • Bull Spread Entry Strength >= "Overlay Signal Strength Level"
    • Limit entry is used, price must be <= close when signaled
    • Entry occurs by next day or the order is cancelled
    • Condition for exit (uses a timed exit):
    • Bars passed since order entry >= 30 (6 weeks..~42 calendar days)
    • Thursday (day before "option" expiration date... assuming weekly options exist)


All of the user settings from the overlay are pulled into this for customization purposes. Details of the actual Spread Entry Strength overlay are as follows (copied from my shared indicator):

2 background shadings will occur:
The background will shade blue if the ticker is prime for a Bullish Call spread.
The background will shade purple if the the ticker is prime for a Bearish Put spread.


In theory, if the SE Strength is at one of the extremes of the Bear or Bull side, then a spread is prime for entry.

To calculate this, 8 conditions receive a 1 or zero dependent on whether the condition is true (1) or false (0), and then all of those are summed. The primary gist of the strength comes from Nishant's book, or my interpretation thereof, with some additives that limits what I need to review (such as condition 8 below.)

The 8 Bull Conditions are:
1) Bollinger Bands are outside of the Keltner Channels
2) ADX is trending up
3) RSI is trending up
4) -DI is trending down
5) RSI is under 30
6) Price is below the lower Keltner Channel
7) Price is between the lower Bollinger Band and the Bollinger basis.
8) Price at one point within the last 5 bars was below the lower Bollinger Band

The 8 Bear Conditions are the inverse conditions (except the first):
1) Bollinger Bands are outside of the Keltner Channels
2) ADX is trending down
3) RSI is trending down
4) +DI is trending up
5) RSI is over 70
6) Price is above the upper Keltner Channel
7) Price is between the upper Bollinger Band and the Bollinger basis.
8) Price at one point within the last 5 bars was above the upper Bollinger Band

There is a "market noise" filter that will filter out shading when another market move is considered, i.e. if you don't want to see the potential trade when QQQ moves more than 1% then do the following in the settings:
Check "Market Filter"
Enter QQQ in the "Market Ticker To Use"
Enter 1 in the "Market Too Hot Level"
Press Ok

Obviously, the same holds true for the "Market Too Cool Filter."

Second release notes:
Overlay Signal Strength Level - You can set your own "level" for the overlay in the settings, instead of having to change the script code itself. I have the default set to 6. A lower number shows more overlays, a higher number shows fewer (i.e. more conditions have been met.).

Provide Narrative (Troubleshooting) - Narrative label created with several outputs that will show after the last bar. This narrative needs to be turned on in the settings, as the default is "off" ... unchecked.

Remove Strength Indicator When Squeezed - when checked no overlays will be produced regardless of "scoring." Default is off.

Show Squeezes (Will Override Indicator When Concurrent) - overlays an orange background when the ticker is in a squeeze. I am still working on the accuracy here, but it's usable. This will override the strength indicator as well. This needs to be turned on, if you want it.

Short SMA Period - period used to calculate the short SMA, used in the narrative only, at this point in time.

Medium SMA Period - period used to calculate the medium SMA, used in the narrative only, at this point in time.

Long SMA Period - period used to calculate the medium SMA, used in the narrative only, at this point in time.

Outside of the settings... a few calculation adjustments here and there have occurred and some color shading adjustments to allow for the adjustable level setting.

Trend Analysis

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

チャートでこのスクリプトを利用したいですか?


There is no market.

免責事項