PROTECTED SOURCE SCRIPT

APIBridge Evening/Morning Star Pattern

437
Strategy Premise

This Strategy works on all the Segments namely Cash , Futures , Options and Commodities

This Strategy Uses Evening / Morning Star Pattern. Here are the characteristics of a Morning Star formation:

The first candlestick is bearish.
The second candlestick has a small body.
It does not matter if the second body is bullish or bearish The small body serves as an indicator that the bears are losing their capacity to drive the market lower. It is also possible for the second candlestick to have no body (a doji).
The third body is bullish that closes within the first candlestick, preferably beyond the halfway point of the first candlestick. This shows that the bulls are gaining control.
Here are the characteristics of an Evening star formation:

Here are the characteristics of an Evening star formation:

The first candlestick strong bullish body.
The second candlestick has a small body.
It can be bullish or bearish. It is also possible for the second candlestick to have no body (a doji).
The third candlestick has a strong bearish body and closes within the body of the first candlestick, preferably beyond the halfway point of the first candlestick in the pattern.




Strategy Logic
Long Entry: When candle1 Closing Price is < candle1 Opening Price and candle2 Opening Price is <= candle2 Closing Price and candle2 BodySize <= .333333*candle1 BodySize and candle2 WickLength is > candle2 BodySize and candle3 Opening Price is >= candle2 Closing Price and candle3 Closing Price is > candle3 Opening Price and candle2 BodySize is <= .333333* candle3 BodySize and candle3 Closing Price > candle1 Opening Price, Send LE.

Long Exit: Either when SL or Target is hit. If SL/TGT is not hit and candle1 Closing Price is > candle1 Opening Price and candle2 Opening Price is >= candle2 Closing Price and candle2 BodySize is <= .333333* candle1 BodySize and candle2 WickLength is > candle2 BodySize and candle3 Opening Price is >= candle2 Closing Price and candle3 Closing Price is < candle3 Opening Price and candle2 BodySize is <= .333333* candle3 BodySize and candle3 Closing Price is < candle1 Opening Price send LX and SE

Short Entry: When candle1 Closing Price is > candle1 Opening Price and candle2 Opening Price is >= candle2 Closing Price and candle2 BodySize is <= .333333* candle1 BodySize and candle2 WickLength is > candle2 BodySize and candle3 Opening Price is >= candle2 Closing Price and candle3 Closing Price is < candle3 Opening Price and candle2 BodySize is <= .333333* candle3 BodySize and candle3 Closing Price is < candle1 Opening Price , Send SE

Short Exit: Either when SL or Target is hit. If SL/TGT is not hit and candle1 Closing Price is < candle1 Opening Price and candle2 Opening Price is <= candle2 Closing Price and candle2 BodySize <= .333333*candle1 BodySize and candle2 WickLength is > candle2 BodySize and candle3 Opening Price is >= candle2 Closing Price and candle3 Closing Price is > candle3 Opening Price and candle2 BodySize is <= .333333* candle3 BodySize and candle3 Closing Price > candle1 Opening Price send SX and LE




Perameter Defination
Backtesting : Use this to backtest the strategy between Starting and Ending Date and time , it can also be used to set trades in future time
Alert_Message : Need to copy while creating alert into Message Box
Trade Setup : Intraday / Positional (Selecct accordingly)
Start Time Stop Time (Session 1) : Intraday / Positional start time and end time of trade for session 1
End Session 1 : Define time to exit any existing position taken in session 1 so that exchange charges will not apply
Use Second Session : Check this to use second intraday session
Start Time Stop Time (Session 2) : Intraday / Positional start time and end time of trade for session 2
End Session 1 : Define time to exit any existing position taken in session 2 so that exchange charges will not apply
Use Target : check if you want to set required target if not cheque will not applicable
Use StopLoss : Cheque if you want to set stop loss if not cheque will not applicable
Trailling Stoploss : Cheque if you want to set trailing stop loss if not cheque will not applicable
Point Or Percentage For TG SL : Use Points or Percentage as per your choice
Target : Set as per the selection of (Point Or Percentage For TG SL)
Stop Loss : Set as per the selection of (Point Or Percentage For TG SL)
TSL_Type : Select as per your logic in %/ATR/Points
TSL_Input : Set in case you select %/Points in TSL_Type
ATR Length : Set as per your logic if you select ATR in the field of TSL_Type
ATR_Mult : Set as per your logic if you select ATR in the field of TSL_Type
Segment : Select segment of your logic EQ/FUTIDX/FUTSTK/OPTIDX/OPTSTK/FUTCUR/FUTCUM (Used in case of option / Futures )

Select Expiry Date : Select the expiry date of your trade as per the segment you selected (Used in case of option / Futures )
Select Expiry Month : Select the expiry Month of your trade as per the segment you selected (Used in case of option / Futures )
Year : Select the expiry Year of your trade as per the segment you selected (Used in case of option / Futures )
Quantity : Enter the quantity in which you want to trade (Used in case of option / Futures )
Product Type : Select MIS/Normal/ CNC as per your logic (Used in case of option / Futures )
Order Type : Select Market/Limit as per your logic (Used in case of option / Futures )
Strategy Tag : Enter the value in case you are using webhook / advance template in APIBridgeTM
Lotsize : Enter the lotsize as per your lotic and quentity selection (Used in case of option / Futures )
STEP (OTM/ATM/ ITM ) : Select OTM(+1)/ATM(0)/ ITM (-1) as per your logic works in case of options only
DIFFERENCE_BETWEEN 2 STRIKE : Select difference of 2 strikes you have used in APIBridge symbol setting list, like for Nifty 50 BankNifty 100
APIB Port : Set as per provided to you by Algoji in case of webhook / advance templet
The Segment full form is given below
EQ Equity
FUTIDX Future Index
FUTSTK Future Stock
OPTIDX Index Option
OPTSTK Stock Option
FUTCUR Futcur Currency
FUTCUM Future Commodity

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.