Algo Trading using Gap Breakout Strategy
Nov-Algo Trading using Gap Breakout Strategy
In this episode, we will be scripting a Strategy for intraday traders to trade the gap ups and gap downs based on price breakout. This strategy is back-testable.
First, let’s discuss about the strategy. This involves GAP breakout..
Strategy is very simple. when the market open with gap up and at the same time ,it crossed the previous day high then it should be considered as strong buy. When the market open with gap down and while opening if it crosses yesterday low then it should be considered as strong short.
So, let’s begin with the rules….
Rules
Buy : We need to buy, If stock Gap Ups and then price breaks the High of previous day
Short : We need to short, If stock Gap Downs and then price breaks the low of previous day
Sell : We need to sell (i.e) Exit Longs if the target is met or exit at eod
Cover : We need to cover (i.e) Exit shorts if the target is met or exit at eod
Moving on to the script part.
First, we are assigning values to basic variables like target % for the trades, previous day’s high, low, close values and today’s open price.
Then we are checking for gapup and gapdown using builtin function in the next 2 lines. And then plotting shapes near such areas in the chart for identification.
And now comes the buy and sell signal,
We will buy, if there is a gapup and price crosses above the previous day’s high.
Likewise, We will short, if there is a gapdown and price crosses below the previous day’s low.
Next set of code is to assign entry price and exit the trades if the target is hit. If either TGT or we reach EOD.
Lastly, we are plotting all these trading signals in the charts, followed by price chart.
Check Out Script Library to get script used for this episode:
https://marketsecrets.in/script-library/
To know more, checkout:
https://youtu.be/l912B1zV1V8
Related
amibroker tutorial videos Getting started with algo-trading basics how to backtest a trading strategy? how to do algo trading in india? how to do algo trading in Zerodha? how to learn algo trading? how to start with algo trading in india? how to use amibroker afl for algo trading? how to write algo trading scripts? Pine script tutorial videos step-by-step approach to start with algo-trading in India