OPEN-SOURCE SCRIPT
Everyday 0002 _ MAC 1st Trading Hour Walkover

This is the second strategy for my Everyday project.
Like I wrote the last time - my goal is to create a new strategy everyday
for the rest of 2016 and post it here on TradingView.
I'm a complete beginner so this is my way of learning about coding strategies.
I'll give myself between 15 minutes and 2 hours to complete each creation.
This is basically a repetition of the first strategy I wrote - a Moving Average Crossover,
but I added a tiny thing.
I read that "Statistics have proven that the daily high or low is established within the first hour of trading on more than 70% of the time."
(source: )
My first Moving Average Crossover strategy, tested on VOLVB daily, got stoped out by the volatility
and because of this missed one nice bull run and a very nice bear run.
So I added this single line: if time("60", "1000-1600") regarding when to take exits:
if time("60", "1000-1600")
strategy.exit("Close Long", "Long", profit=2000, loss=500)
strategy.exit("Close Short", "Short", profit=2000, loss=500)
Sweden is UTC+2 so I guess UTC 1000 equals 12.00 in Stockholm. Not sure if this is correct, actually.
Anyway, I hope this means the strategy will only take exits based on price action which occur in the afternoon, when there is a higher probability of a lower volatility.
When I ran the new modified strategy on the same VOLVB daily it didn't get stoped out so easily.
On the other hand I'll have to test this on various stocks .
Reading and learning about how to properly test strategies is on my todo list - all tips on youtube videos or blogs
to read on this topic is very welcome!
Like I said the last time, I'm posting these strategies hoping to learn from the community - so any feedback, advice, or corrections is very much welcome and appreciated!
/pbergden
Like I wrote the last time - my goal is to create a new strategy everyday
for the rest of 2016 and post it here on TradingView.
I'm a complete beginner so this is my way of learning about coding strategies.
I'll give myself between 15 minutes and 2 hours to complete each creation.
This is basically a repetition of the first strategy I wrote - a Moving Average Crossover,
but I added a tiny thing.
I read that "Statistics have proven that the daily high or low is established within the first hour of trading on more than 70% of the time."
(source: )
My first Moving Average Crossover strategy, tested on VOLVB daily, got stoped out by the volatility
and because of this missed one nice bull run and a very nice bear run.
So I added this single line: if time("60", "1000-1600") regarding when to take exits:
if time("60", "1000-1600")
strategy.exit("Close Long", "Long", profit=2000, loss=500)
strategy.exit("Close Short", "Short", profit=2000, loss=500)
Sweden is UTC+2 so I guess UTC 1000 equals 12.00 in Stockholm. Not sure if this is correct, actually.
Anyway, I hope this means the strategy will only take exits based on price action which occur in the afternoon, when there is a higher probability of a lower volatility.
When I ran the new modified strategy on the same VOLVB daily it didn't get stoped out so easily.
On the other hand I'll have to test this on various stocks .
Reading and learning about how to properly test strategies is on my todo list - all tips on youtube videos or blogs
to read on this topic is very welcome!
Like I said the last time, I'm posting these strategies hoping to learn from the community - so any feedback, advice, or corrections is very much welcome and appreciated!
/pbergden
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。