Algo Trading using Gap Breakout Strategy

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

 

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!