TradingView
ZenAndTheArtOfTrading
28 apr 2021 02:39

Hammers & Stars Strategy 

EUR/JPYOANDA

Descrizione

[u]Overview[/u]

This script trades basic hammer and shooting star candlestick patterns.

It's an extremely simple strategy with minimal filters, and according to my personal manual backtesting and automated trading results, performs best on the Daily chart on certain forex pairs.

It is intended to be traded on the forex markets but theoretically should work on all markets (especially if you optimize the settings).

The script also comes with complete AutoView automation for Oanda.

Make sure you've connected AutoView to TradingView and Oanda, then simply set an alert using the "alert() function calls only" condition and it will automatically execute trades based on whatever settings you've selected (only recommended for experienced traders - use at your own risk!)

If you're not sure how to set up AutoView, search "The Art of Trading AutoView Guide" on YouTube to find my detailed video guide.

Check out my website and YouTube channel for more information, scripts, resources and free Pine Script & trading lessons (link in my profile).

Best of luck with your trading!

- Matt / The Art of Trading



[u]Settings Menu[/u]
Tooltips are included explaining what the various settings do, but here's a quick summary:

[u]Strategy Settings[/u]
>= ATR Filter: Minimum size of entry candle compared to ATR
<= ATR Filter: Maximum size of entry candle compared to ATR
Stop Loss ATR: Stop loss multiplier (x ATR)
R:R: Risk:Reward profile
Fib Level: Used to calculate upper/lower third of candle. (For example, setting it to 0.5 will mean hammers must close >= 50% mark of the total candle size)
Start Date Filter: Date & time to begin trading from
End Date Filter: Date & time to stop trading

[u]AutoView Oanda Settings[/u]
Use Oanda Demo: If turned on then oandapractice broker prefix will be used for AutoView alerts (demo account). If turned off then live account will be used
Use Limit Order: If turned on then AutoView will use limit orders. If turned off then market orders will be used (recommended to use limit order to mitigate spread issues)
Days To Leave Limit Order: This is your GTD setting (good til day)
Account Balance: Your account balance (used for calculating position size)
Account Currency: Your account balance currency (used for calculating position size)
Risk Per Trade %: Your risk per trade as a % of your account balance

Note di rilascio

-
- Added PineConnector integration
- Added EMA filter (optional)
- Fixed transp warnings
- Added custom backtester display that risks % of account balance per trade
- USE THESE FEATURES AT YOUR OWN RISK: ALWAYS DO YOUR OWN RESEARCH & MANUAL BACKTESTING!

Note di rilascio

- Added redundancy alert to cancel pending limit orders on PineConnector if stops or targets are hit before the entry order is filled

Note di rilascio

-
- Fixed a bug with backtester display

Note di rilascio

- Removed some redundant code
Commenti
realpirateking
I tried to use this indicator on tradingview with Forex.com live account. But indicator didnt work. Can you pls help?
profitalgo
Thanks for sharing the script.

I see here the net equity value / net profit gained is only 0.1% if we started trading from 2005. How effective would this be in actual trading ?
ZenAndTheArtOfTrading
@profitalgo, It depends entirely on your position size and risk management techniques and R:R and which markets the strategy is used on :)

I ignore the $ equity gain/loss in the TradingView Strategy Tester because I don't use a fixed position size like the tester does, but rather a dynamic one that changes on each trade based on my account balance. When I published this script I guess I had the position size set to 1 contract because I was more interested in the win rate which is why the $ gain is so low

I personally use this script to scan for markets with a high win rate and then I manually backtest to see what those numbers turn out to be. In my testing on EURJPY with a 1.4R and 2% risk per trade I had a 200% gain for example, which isn't much over 16 years but it compounds when combined with other markets and other strategies.

This is intended to be an extremely low-maintenance background strategy that is supplemented by other more active strategies to compound your long term returns, not traded on its own as that would be a waste of time. But if you find 6+ markets to trade this strategy on it can net 10%+ per year on average with the right parameters which is a decent profit for a strategy that only requires a minute or two per day to execute
profitalgo
@ZenAndTheArtOfTrading, Thanks for the explanation. What is R:R you mentioned ?

Your comment helped me to come up a simple metric to asses the gains and risk of a strategy that I call GR metric => Gain x Risk metric

GR = (1 - invested_amount/initial_equity) x (1 + returns / invested_amount)

Here it will penalize for very risk appetite and also for low returns whose min value is zero. For a balanced approach let's say 50% invested capital with good 10% returns the value is 0.55

Thanks!
jwhiteford
@profitalgo, R:R is Risk to Reward.
RataTutu
Target and SL lines are changing in between the trade. especially, if there is another entry right after the first trade. Even with the command line strategy.position_size != 0 that issue is not resolving. Any thoughts on it.
ambarrlite
Thank you very much.
Altro