PROTECTED SOURCE SCRIPT
APIBridge Hammer Strategy

Strategy Premise
A hammer is a price pattern in candlestick charting that occurs when a security trades significantly lower than its opening price, but rallies within the period to close near the opening price.
This pattern forms a hammer-shaped candlestick, in which the lower shadow is at least twice the size of the real body. The body of the candlestick represents the difference between the open and closing prices, while the shadow shows the high and low prices for the period.
Strategy Logic
Long Entry: When (closing Price – opening Price) is > 0 and (closing Price – opening Price) / 3 is > (high price – closing Price) and (opening Price – low Price) /2 is > (closing Price –opening Price) and (closing Price – opening Price) is > (opening Price – low Price) /8, Send LE.
Long Exit: Either when SL or Target is hit. If SL/TGT is not hit and (opening Price – closing Price) is > 0 and (opening Price – closing Price) /3 is > (high Price – open Price) and (closing Price – low Price) /2 is > (opening Price – closing Price) and (opening Price – closing Price) is > (closing Price – low Price) / 8, send LX and SE.
Short Entry: When (opening Price – closing Price) is > 0 and (opening Price – closing Price) /3 is > (high Price – open Price) and (closing Price – low Price) /2 is > (opening Price – closing Price) and (opening Price – closing Price) is > (closing Price – low Price) / 8, Send SE.
Short Exit: Either when SL or Target is hit. If SL/TGT is not hit and (closing Price – opening Price) is > 0 and (closing Price – opening Price) / 3 is > (high price – closing Price) and (opening Price – low Price) /2 is > (closing Price –opening Price) and (closing Price – opening Price) is > (opening Price – low Price) / 8 send SX and LE.
Strategy Parameters on Tradingview
1.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
2.Alert_Message : Need to copy while creating alert into Message Box
3.Trade Setup : Intraday / Positional (Selecct accordingly)
4.Start Time Stop Time (Session 1) : Intraday / Positional start time and end time of trade for session 1
5.End Session 1 : Define time to exit any existing position taken in session 1 so that exchange charges will not apply
6.Use Second Session : Check this to use second intraday session
7.Start Time Stop Time (Session 2) : Intraday / Positional start time and end time of trade for session 2
8.End Session 1 : Define time to exit any existing position taken in session 2 so that exchange charges will not apply
9.Use Target : check if you want to set required target if not cheque will not applicable
10.Use StopLoss : Cheque if you want to set stop loss if not cheque will not applicable
11.Trailling Stoploss : Cheque if you want to set trailing stop loss if not cheque will not applicable
12.Point Or Percentage For TG SL : Use Points or Percentage as per your choice
13.Target : Set as per the selection of (Point Or Percentage For TG SL)
14.Stop Loss : Set as per the selection of (Point Or Percentage For TG SL)
15.TSL_Type : Select as per your logic in %/ATR/Points
16.TSL_Input : Set in case you select %/Points in TSL_Type
17.ATR Length : Set as per your logic if you select ATR in the field of TSL_Type
18.ATR_Mult : Set as per your logic if you select ATR in the field of TSL_Type
19.Segment : Select segment of your logic EQ/FUTIDX/FUTSTK/OPTIDX/OPTSTK/FUTCUR/FUTCUM (Used in case of option / Futures )
20.Select Expiry Date : Select the expiry date of your trade as per the segment you selected (Used in case of option / Futures )
21.Select Expiry Month : Select the expiry Month of your trade as per the segment you selected (Used in case of option / Futures )
22.Year : Select the expiry Year of your trade as per the segment you selected (Used in case of option / Futures )
23.Quantity : Enter the quantity in which you want to trade (Used in case of option / Futures )
24.Product Type : Select MIS/Normal/ CNC as per your logic (Used in case of option / Futures )
25.Order Type : Select Market/Limit as per your logic (Used in case of option / Futures )
26.Strategy Tag : Enter the value in case you are using webhook / advance template in APIBridgeTM
27.Lotsize : Enter the lotsize as per your lotic and quentity selection (Used in case of option / Futures )
28.STEP (OTM/ATM/ ITM ) : Select OTM(+1)/ATM(0)/ ITM (-1) as per your logic works in case of options only
29.DIFFERENCE_BETWEEN 2 STRIKE : Select difference of 2 strikes you have used in APIBridge symbol setting list, like for Nifty 50 BankNifty 100
30.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
A hammer is a price pattern in candlestick charting that occurs when a security trades significantly lower than its opening price, but rallies within the period to close near the opening price.
This pattern forms a hammer-shaped candlestick, in which the lower shadow is at least twice the size of the real body. The body of the candlestick represents the difference between the open and closing prices, while the shadow shows the high and low prices for the period.
Strategy Logic
Long Entry: When (closing Price – opening Price) is > 0 and (closing Price – opening Price) / 3 is > (high price – closing Price) and (opening Price – low Price) /2 is > (closing Price –opening Price) and (closing Price – opening Price) is > (opening Price – low Price) /8, Send LE.
Long Exit: Either when SL or Target is hit. If SL/TGT is not hit and (opening Price – closing Price) is > 0 and (opening Price – closing Price) /3 is > (high Price – open Price) and (closing Price – low Price) /2 is > (opening Price – closing Price) and (opening Price – closing Price) is > (closing Price – low Price) / 8, send LX and SE.
Short Entry: When (opening Price – closing Price) is > 0 and (opening Price – closing Price) /3 is > (high Price – open Price) and (closing Price – low Price) /2 is > (opening Price – closing Price) and (opening Price – closing Price) is > (closing Price – low Price) / 8, Send SE.
Short Exit: Either when SL or Target is hit. If SL/TGT is not hit and (closing Price – opening Price) is > 0 and (closing Price – opening Price) / 3 is > (high price – closing Price) and (opening Price – low Price) /2 is > (closing Price –opening Price) and (closing Price – opening Price) is > (opening Price – low Price) / 8 send SX and LE.
Strategy Parameters on Tradingview
1.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
2.Alert_Message : Need to copy while creating alert into Message Box
3.Trade Setup : Intraday / Positional (Selecct accordingly)
4.Start Time Stop Time (Session 1) : Intraday / Positional start time and end time of trade for session 1
5.End Session 1 : Define time to exit any existing position taken in session 1 so that exchange charges will not apply
6.Use Second Session : Check this to use second intraday session
7.Start Time Stop Time (Session 2) : Intraday / Positional start time and end time of trade for session 2
8.End Session 1 : Define time to exit any existing position taken in session 2 so that exchange charges will not apply
9.Use Target : check if you want to set required target if not cheque will not applicable
10.Use StopLoss : Cheque if you want to set stop loss if not cheque will not applicable
11.Trailling Stoploss : Cheque if you want to set trailing stop loss if not cheque will not applicable
12.Point Or Percentage For TG SL : Use Points or Percentage as per your choice
13.Target : Set as per the selection of (Point Or Percentage For TG SL)
14.Stop Loss : Set as per the selection of (Point Or Percentage For TG SL)
15.TSL_Type : Select as per your logic in %/ATR/Points
16.TSL_Input : Set in case you select %/Points in TSL_Type
17.ATR Length : Set as per your logic if you select ATR in the field of TSL_Type
18.ATR_Mult : Set as per your logic if you select ATR in the field of TSL_Type
19.Segment : Select segment of your logic EQ/FUTIDX/FUTSTK/OPTIDX/OPTSTK/FUTCUR/FUTCUM (Used in case of option / Futures )
20.Select Expiry Date : Select the expiry date of your trade as per the segment you selected (Used in case of option / Futures )
21.Select Expiry Month : Select the expiry Month of your trade as per the segment you selected (Used in case of option / Futures )
22.Year : Select the expiry Year of your trade as per the segment you selected (Used in case of option / Futures )
23.Quantity : Enter the quantity in which you want to trade (Used in case of option / Futures )
24.Product Type : Select MIS/Normal/ CNC as per your logic (Used in case of option / Futures )
25.Order Type : Select Market/Limit as per your logic (Used in case of option / Futures )
26.Strategy Tag : Enter the value in case you are using webhook / advance template in APIBridgeTM
27.Lotsize : Enter the lotsize as per your lotic and quentity selection (Used in case of option / Futures )
28.STEP (OTM/ATM/ ITM ) : Select OTM(+1)/ATM(0)/ ITM (-1) as per your logic works in case of options only
29.DIFFERENCE_BETWEEN 2 STRIKE : Select difference of 2 strikes you have used in APIBridge symbol setting list, like for Nifty 50 BankNifty 100
30.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
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Regards,
Algoji Enterprises Private Limited
APIBridge™
Algoji Enterprises Private Limited
APIBridge™
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Regards,
Algoji Enterprises Private Limited
APIBridge™
Algoji Enterprises Private Limited
APIBridge™
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.