TJalam

Break of structure (BOS) forex Strategy

TJalam Cập nhật   
Please read all Details before using this indicator
This strategy is based on taking position after the break of a Previous High/Low swing happens (fixed time frame), the break of structure happens because of the swing happens then we go long or short respectively in this strategy.
I will be discussing the setting details through which you can make it work on different forex pairs.

Does it work on other pairs?
Yes, I have found similar back test results on other USD pairs.

Does it works on smaller time frame?
Yes it does work on smaller time frame , you have to understand the below concepts used and try different settings.
For the user the most important thing is to understand the settings of the indicator so that they can optimize the setting and get the best results:

This indicator contains the following IMPORTANT setting:
i. Fixed trading session for long trades (long position can be taken in that period of time only)
ii. Fixed trading session for short trades (Short position can be taken in that period of time only)

The concept behind restricting the time to go long or short is because in forex the particular pair move in a particular direction depending upon the currency and time zones.
This strategy works on different forex pairs, you need to find the best settings. I will be providing the best settings which works for this strategy and different pairs.

2. Choose Previous High/Low Timeframe
This is the most important option where you have to choose the timeframe for which you want H/L by default it is set to “D”. This timeframe H/L reference will be taken for taking trading decisions.

3.Setting for back test selection date range you can check the beck test of a particular time range.

4.You can check Long and Short positions performance separately, by unchecking the “Go_long” option it will remove all long positions from back test. Vice versa for “Go_short option”

5.Internal Bar Strength
IBS is simply an indicator where you buy on weakness and sell on strength, the cornerstone of any mean-reverting strategy.
It oscillates from zero to one and measures the relative position of the closing price relative to the High and Low.
IBS = (Close – Low) / (High – Low)

In the input setting the you can disable enable the IBS option from the strategy.

6. Parkinson volatility
Parkinson volatility is a volatility measure that uses the stock’s high and low price of the day (can be changed in the setting, instead of day it can be set to any bar length)
The main difference between regular volatility and Parkinson volatility is that the latter uses high and low prices for a day, rather than only the closing price.

In the setting you have three option
i. Enter Volatility Threshold
If the Parkinson volatility value is greater than the the threshold value then it lets the trade happen.
ii.Set the high/low bar time frame for calculating Parkinson volatility. ( Set 60m by default)

Formula used as below:
high_=security(syminfo.ticker, input("60"), high)
low_=security(syminfo.ticker, input("60"), low)
hourlyRangeSquared = pow((log(high_) - log(low_)), 2)
dailyParkinsonVol = sqrt(sum(hourlyRangeSquared, 24) / (4 * log(2)))


7. "Enter no of contract size"
This setting helps you to set the contract size , by default it is set to 100000.

8. “Zigzag Filter Length” this setting is for SWING H/L Lookback. With the help of this I have ploted Swing Support and Resistance.

9.Futrther confirmation of trade is done through the RSI criteria. In this I have provided four kind of RSI confirmation you can test all by selecting any one of the four.

i. filter trade on the basis of BB of RSI (as shown in the image)
ii. filter trade on the basis of RSI Levels (RSI>50 for long, vice versa for short)
iii. filter trade by rsi>basis of BB of RSI(for long) & rsi<50(for short)
iv. filter trade by rsi>50(long) & rsi< basis of BB of RSI(short)

SELECT ONLY ONE OF THE ABOVE IN SETTING.


10.For Exiting the trade I have used the trailing SL you can change it in setting.
You can exit the trade using two targets (two take profit) using different size for exiting the trade.

If you want to take only on target then you have to make QANTITY of shares for 1st Exit as 100. Then you will exit all your position in the first target.


A big thanks to kodify.net there articles are very helpful kodify.net/tradingvi...rogramming-articles/

Thanks to Mickey for providing assistance.

Thanks to stack overflow community for clearing the doubts.

Trading view official documentation on V4 of pine script also helped me.




Phát hành các Ghi chú:
Removed some errors
Phát hành các Ghi chú:
added visual description and removed typo error.
Phát hành các Ghi chú:
Description on chart added .
Phát hành các Ghi chú:
Major Updates Done.
Better Setting Options.
Phát hành các Ghi chú:
minor update
Phát hành các Ghi chú:
converted to version 5

An enthusiast trader. I code my strategies in pine script.DM me for any Info.
Buy me coffee at:
paypal : tabrejalam786007@gmail.com
BTC : 15zY6PUsrV55UQvcfaSqk5hJexKZAwhpcK
TRC20: TPutH6FDYg6bJFF7xCjesp4n44qrMnizc7
Tập lệnh chỉ hiển thị cho người được mời

Quyền truy cập vào tập lệnh này bị hạn chế đối với người dùng được tác giả ủy quyền và thường yêu cầu thanh toán. Bạn có thể thêm nó vào mục yêu thích của mình, nhưng bạn sẽ chỉ có thể sử dụng nó sau khi yêu cầu sự cho phép từ tác giả. Liên hệ TJalam để thêm thông tin, hoặc làm theo hướng dẫn của tác giả bên dưới.

TradingView không đề xuất trả tiền cho một tập lệnh và sử dụng cho đến khi bạn hoàn toàn tin tưởng tác giả và hiểu cách thức hoạt động của tập lệnh. Trong nhiều trường hợp, bạn có thể tìm thấy một giải pháp thay thế nguồn mở miễn phí trong Thư viện Công cộng của chúng tôi.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Hướng dẫn của tác giả

if you want to test this strategy than please DM me for one week trail . Before using this strategy please read all instructions and DISCLAIMER. Do your own research before taking trades.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Cảnh báo: vui lòng đọc trước khi yêu cầu quyền truy cập.