Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Recommended Posts

Hi Guys,

 

I'm new here, so I'm going to try to commit some time on how I'm building an automated trading strategy using technicals within NinjaTrader. I consider myself a knowledgeable trader, yet there's always things to learn and discover every day.

 

These series of articles is to spur discussion and hopefully give some of my trading insights away to the community.

 

That being said, I'm going to begin with how I identify reversals.

 

Identifying Reversals

 

Nothing is easier than to identify amazing trading opportunities looking at a chart in

hindsight. As we all know, doing the same in real time is a different ball game. In the

chart below (showing the ES-mini of last Friday, March 19, 2013) I marked, in hindsight,

what would have been some good entry points, either on the long or short side. Wouldn’t

it be nice if we could spot some of those opportunities as they occur, in real time?

 

8678540198_e3638b2687_c.jpg

ES1 by TraderFrank, on Flickr

 

To find out, I employed my favourite tool for the past year or so, Bloodhound from Shark

Indicators. (Bloodhound runs on Ninjatrader).

 

I started out by trying to define what seem to be some of the common characteristics of

the situations marked on the chart in yellow. I’ve found the following:

 

  • most yellow circles contain candles with long tails and/or long candles with no tails at all
  • good long entries start with an up candle and vice versa
  • the candles in yellow are close to the opposite Bollinger (2,20) lines (lower line for longs, upper line for shorts)
  • the MACD is below 0 in the case of long signals and above 0 for shorts

 

Let’s see how we could define these rules in Bloodhound. (For our exercise, I’ll assume the reader is somewhat familiar with Bloodhound, and has a basic understanding of the Solvers and the Logic and Function nodes).

 

First, let’s define long bottom tails with the Indicator Comparison solver by comparing the Low to the Open of the current bar. More precisely, we’ll want to find candles where the Low is “much lower” than the Open. (Note: price data can be accessed through SIChameleon, a Bloodhound component, on the indicator list). A welcome suggestion from Zac White of Shark Indicators to use the ATR measurement unit to identify candles with long tails allows us to create a signal that will work on all types of charts, whether they’re range, tick, renko, or time charts. And by setting the ATR period to 1, we effectively tell Bloodhound to evaluate the current candle only. Very useful.

 

See the settings below.

 

8677434931_e8eff4e030_c.jpg

Settings 1 by TraderFrank, on Flickr

 

Notice how we define “much lower”: while we could use the default Ticks as measurement unit, by using a 1 period ATR with a Value of 0.5 and the Long Output setting as shown, we are telling Bloodhound to mark any candle where the Low is at least 50% lower than the Open. (The 0.5 setting, of course, is not written in stone. E.g. a setting of 0.33 would mark bars whose tail is at least one third of the whole candle.)

 

After adding a Bar Direction solver to our logic, we would get this:

 

8677434981_1da8b3d320_c.jpg

Settings 2 by TraderFrank, on Flickr

 

Now let’s say, I only want long candles with no top tail: no pullback, just sheer momentum. I can do that by adding another Comparison Solver with the setting Close=High (Opposite settings for shorts).

 

So far so good. But what if I also want to include long candles with no tail at all? They definitely indicate momentum. ATR, again, comes to our help: the Comparison solver with the Open<Close by 1 ATR setting will spot long green bars with no tails.

 

No let’s see how we could put all these ingredients into a logic.

 

8677435013_f88dd7aab7_z.jpg

Settings 3 by TraderFrank, on Flickr

 

Now, since we are interested in long bottom tails with a MACD<0 and Low<BollingerLower setting, we can add an If Then filter to the equation.

 

The logic, with the mirror code for shorts added, will look like this:

 

8678540298_3921b91a30_c.jpg

Settings 4 by TraderFrank, on Flickr

 

Looks complicated at first sight, but if we read the chart step by step, it’s quite easy to follow the logic.

 

Finally, let’s see what signals this code would give us for the ES on March 19, and compare it with the “ideal” signals above.

 

8677486909_373f582ac0_c.jpg

ES After by TraderFrank, on Flickr

 

Not bad at all. While a signal or two are clearly misses, the majority of the “racing lines” seem quite usable.

 

Now up to the next steps: fine-tuning and backtesting, then defining some sound money management, not to mention controlling nerves. But those must be topics of future articles.

 

Happy experimenting and successful trading to all!

Share this post


Link to post
Share on other sites

Frank,

 

Thank you for taking the time to post this. I certainly appreciate the detail you used when working through the triggers. I will be curious to see how the backtesting and money mgmt portions either show this to be a productive (profitable) system or not. The details are where the edge will be flushed out or not.

 

Again, thanks for your effort and keep up with your great post.

Share this post


Link to post
Share on other sites

Hi guys,

in the past week or so, I experimented with the Bloodhound code described in Part 1.

 

I ended up with a version that is only slightly different from the one included in my first article. I implemented one modification (the Signal Blocker function node) just to get rid of multiple signals firing off consecutively, thereby making the chart a bit cleaner. The second modification was to include a Time Solver since I will not want to have signals before 7am and after 3.50pm. I also changed the setting for Bollinger to 2.5/20, to spot the most extreme cases (and to trade less). The third modification is also material: I changed the 0.5 ATR setting to 0.33ATR, thereby including candles whose third is made up of the tail. The reason being that I backtested the code with both settings (for 90 days), and the 0.33 version resulted in more profit. More about that later. First, here’s the latest version of the ‘Long Tail’ code:

 

8702569993_c37fc88d9e.jpg

Article 2 Chart 1 Long Tail by traderfrank2013, on Flickr

 

 

I know, it seems overwhelming first (it did for me). What I do with these long codes is that I disconnect most things, and connect them again one by one to see which Solver/Node/Function does what. Watching the changes in real time on the chart makes it easy to follow the logic.

 

Now, before I tell you about the backtesting results, a few ’tips and tricks’ that I find useful in Bloodhound, and which may be of interest to some of you as well.

 

Let’s say, I like this code, I tested it, I got to trust it, I made it mine, etc. But let’s say, I’m a discretionary trader at heart and I want to place the trades manually, albeit based on the signals Bloodhound gives me. Also, I recognize that no system is perfect, and there may be market conditions in which I do not want to place trades (although I may get signals), or I only want to place trades in a certain direction (although the code would give me both long and short signals). Here’s what I do:

 

On Bloodhound’s Logic tab, I click on Copy to make a copy of this logic. Then I disconnect the short signal and save the code with the name Long Only, like this:

 

8703689644_7f9a78671e.jpg

Article 2 Chart 2 Long Only by traderfrank2013, on Flickr

 

Then I do the same for shorts. Then, I disconnect the line between the last Or and the Result, and save it as No Trade.

 

What I’ll get in the chart will be a Bloodhound drop-down list, where I can manually choose what type of signals, if any, I want to get on the chart. For rule-based manual trading, it’s quite handy.

 

Now, to backtesting the code. To start, I right-clicked on the chart to select Data Series, and set Days to Load to, say, 90. I also checked that the Show Chart Trader setting is off (false). Then right-clicking on the chart, and selecting Strategies, I double-clicked on SiRaven, the simple strategy manager included with Bloodhound. I chose Long Tail (that’s the name I gave to my code). I experimented with various target and stop/trailing stop settings but none of them produced a profit, until I tried a little trend indicator gem (available from BigMike, I believe), called TCTrendingTSF. Worth checking it out.

I added an Inflection Solver using TCT, as shown below, making sure I choose the Signal Direction setting to tell me when it changes color (as opposed to the slope).

 

8703688984_75a32f9289.jpg

TSF setting by traderfrank2013, on Flickr

 

 

Next, I created a very simple new logic, shown below, and named it Exit.

 

8703689212_60dd331a0d.jpg

exit by traderfrank2013, on Flickr

 

I did all this, because I wanted to specify an Entry Logic as well as an Exit logic for my strategy, like this:

 

8703689142_90006f1382.jpg

strategy exit by traderfrank2013, on Flickr

 

(Also, I chose ‘True’ for Enter Only When Flat, to stay in the trade until the exit signal arrives.)

Here’s a few trades. Notice that exits are triggered by the TCT color change.

 

8703689108_e45fa0ecab.jpg

trades by traderfrank2013, on Flickr

 

Now with the strategy running on the chart, right-click, choose Strategy Performance/Historical to see the backtesting results. I got this:

 

8703689504_cfc1ae30a3.jpg

backtesting results by traderfrank2013, on Flickr

 

Mind you, it’s not out of this world, and clearly, more work is needed if we want to run something like this automatically. My exit is pretty crude, too. By exiting manually, either by taking a quick and small loss or a better profit, for example, the results could probably be much improved. I will certainly play around a bit more with a more sophisticated, rule-based exit strategy in the coming days. As is probably apparent, I’m still very much getting acquainted with Bloodhound, and there’s a lot more to be discovered. It would be fun to hear how fellow traders use this tool, as well!

 

Until next time, I hope I managed to demonstrate, to myself and to you, that it is possible to create a profitable, though admittedly at this stage, rather unpolished, strategy with Bloodhound. I also hope there will be readers who’ll find some of the above steps I used useful when working with Bloodhound.

 

 

 

Till next time, happy trading to all!

Trader Frank

Edited by traderfrank
pictures are not showing up

Share this post


Link to post
Share on other sites

Hi to all,

welcome to part three of my article on trying to devise an “automated” trading system with Bloodhound. I should mention that by “automated”, I mean “to a large part, automatic”, meaning there may be some limitations to fully automated trading, namely:

 

• the system would never be run unattended

• the right would be reserved to use the drop-down menus created for long and short entries and/or for ‘no trade’ periods (see previous article) to filter some or all of the signals if, in the trader’s opinion, market conditions so require

• while entries would be handled by the Bloodhound code, the trader may choose to exit manually from ‘hopeless’ trades.

 

So with the above out of the way, let me refer back to the strategy created in the previous post. As you recall, it made $500 in 90 days. (I should mention that, initially, for weeks and weeks, I was not able to devise a system with Bloodhound that would bring a positive result in automated mode, so I regarded that $500 system as a big achievement when it was done.) But as I learned more about the product, I wanted to see if I could tweak the code to improve on that first humble result.

 

Here’s the new, slightly modified version of the code. Let’s call it the final version of the ‘Long Tail’ idea:

 

8762178545_acd90a4b21.jpg

Article 3 Chart 1 by traderfrank2013, on Flickr

 

I played around with various versions of the same basic idea to see how much I can improve on the results. I tried about 20 slightly different codes, until I ended up with the one above. Interestingly, the “winner” is not that different from the version in Article 2. The main difference is that I extended the signal for a few more bars (8, to be precise) so that I can use the TCT filter with a setting of 30 and a lookback period of 10. (I mentioned TCT, a type of trend indicator, in the previous article). What I wanted to achieve was that by creating an ‘overlap’ of the base signal and the TCT, I can use the latter to filter out the not-so-good base signals, and keep those that are supported by the TCT. (The overlap, I do recognize, introduces a delay, so by entering later, I know I give up a candle or two but I hope to get a more reliable signal.)

 

The above picture shows both the long and short signals, but of course, the Short Only and Long Only drop-down options (for manual or semi-manual trading) can easily be created, as described previously.

 

To make a long story short, here’s the result of the 90-day backtesting of this code:

 

8763304766_708dda45e8.jpg

Article 3 Chart 2 by traderfrank2013, on Flickr

 

You’re right: it’s 18 times better than the version in my previous article! See the promising equity curve as well:

 

8763304024_121b01397c.jpg

Article 3 Chart 3 by traderfrank2013, on Flickr

 

And the weekly results:

8763303530_2b6c6bd7b7.jpg

Article 3 Chart 4 by traderfrank2013, on Flickr

 

While two of the weeks kind of stand out (one big loser, and one big winner), frankly, it’s better than anything I expected.

 

Let me also attach the strategy settings that produced this result. (As mentioned, I tried various other strategy settings and versions of the code, but even the second best “only” produced $2000. So here are the winning settings:

 

8763303188_1f7a8d89fb.jpg

Article 3 Chart 5 by traderfrank2013, on Flickr

 

As you’ll notice, this is an ‘always-in-the-market’ system, subject to the time solver restriction built in the code. I didn’t really plan it this way, but any exit idea I’ve tried resulted in much less profit (although they were mostly positive). The code/strategy combination above simply stood out from the rest.

 

Before we move on, we have to look at the drawdown stats. What pain must we bear while executing this strategy? See below:

 

8762175841_581a49026d.jpg

Article 3 Chart 6 by traderfrank2013, on Flickr

 

Better than I thought. Now, whatever the results, it is clear that this code/strategy setting combination, like any other, generates a lot of losing trades. Some of them are trades that we would never take manually if we were in control. The same goes for the exits. Since there’s no stop loss specified, the code makes us stay in ‘hopeless’ trades for much too long. (But please note, our largest drawdown in 90 days was a manageable amount.) So with some manual control, the degree and manner of which is up to the individual trader, I assume it would be possible to improve on the results. Also, the more than 4 trades/day may be a bit too many for some of us. Again, either some manual discretion may be applied when entering trades (by using the No Trade drop down menu in unattractive trading situations), or the Time Solver’s settings may be modified as desired to limit the trading period, thereby reducing the number of trades.

 

In the coming days, I’ll have this strategy running in demo mode on one of my charts, to see if the forward testing results measure up to the data above, and also to gauge, what degree of manual interference I would prefer to apply if I ran this with real money on the line.

 

Finally, here’s some chart action from today’s ES session to demonstrate the workings of this system:

 

8762175517_3f712e0709.jpg

Article 3 Chart 7 by traderfrank2013, on Flickr

 

Well, in the past week or so, I certainly learned a lot about how to use Bloodhound to create something useful. I’m especially glad that I was able to improve significantly on the respectable, but rather mediocre results of the code in Article 2.

 

With this third article, I think I’ve covered this initial phase of what I found Bloodhound could be used for. I’m sure there’s many more ways to use this product. I’m still mostly learning how I could put it to good use in my live trading. I do recognize the potential benefits of the various degrees of automation, and this is what made me interested in this product in the first place.

 

As always, I look forward to your comments and experience with using this tool.

 

Thanks for your attention and happy trading to all!

 

Trader Frank

Edited by traderfrank
Pics didn't show up/spelling

Share this post


Link to post
Share on other sites

I really appreciate that you took your time and create this post. I have been in this sector for long time and i saw lots of automated systems but fortunately and unfortunately i never saw a single trader who sustain in this market using only automated system. I would like to suggest to all that if you really want to sustain in this market then you need to understand and analyze this market closely. If you can't addressed this type of mistakes initially then you will have face to face with unpleasant reality.

Share this post


Link to post
Share on other sites

Frank,

I've just discovered your post today and have found what you've written to be so helpful. Thank you so much. I am in the process of getting started with SharkIndicators, just reading your posts have helped my understand the functionality of SI so much better.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • Date: 3rd April 2025.   Gold Prices Pull Back After Record High as Traders Eye Trump’s Tariffs.   Key Takeaways:   Gold prices retreated after hitting a record high of $3,167.57 per ounce due to profit-taking. President Trump announced a 10% baseline tariff on all US imports, escalating trade tensions. Gold remains exempt from reciprocal tariffs, reinforcing its safe-haven appeal. Investors await US non-farm payroll data for further market direction. Fed rate cut bets and weaker US Treasury yields underpin gold’s bullish outlook. Gold Prices Retreat from Record Highs Amid Profit-Taking Gold prices saw a pullback on Thursday as traders opted to take profits following a historic surge. Spot gold declined 0.4% to $3,122.10 per ounce as of 0710 GMT, retreating from its fresh all-time high of $3,167.57. Meanwhile, US gold futures slipped 0.7% to $3,145.00 per ounce, reflecting broader market uncertainty over economic and geopolitical developments.   The recent rally was largely fueled by concerns over escalating trade tensions after President Donald Trump unveiled sweeping new import tariffs. The 10% baseline tariff on all goods entering the US further deepened the global trade conflict, intensifying investor demand for safe-haven assets like gold. However, as traders locked in gains from the surge, prices saw a modest retracement.   Trump’s Tariffs and Their Market Implications On Wednesday, Trump introduced a sweeping tariff policy imposing a 10% baseline duty on all imports, with significantly higher tariffs on select nations. While this move was aimed at bolstering domestic manufacturing, it sent shockwaves across global markets, fueling inflation concerns and heightening trade war fears.   Gold’s Role Amid Trade War Escalations Despite the widespread tariff measures, the White House clarified that reciprocal tariffs do not apply to gold, energy, and ‘certain minerals that are not available in the US’. This exemption suggests that central banks and institutional investors may continue favouring gold as a hedge against economic instability. One of the key factors supporting gold is the slowdown that these tariffs could cause in the US economy, which raises the likelihood of future Federal Reserve rate cuts. Gold is currently in a pure momentum trade. Market participants are on the sidelines and until we see a significant shakeout, this momentum could persist.   Impact on the US Dollar and Bond Yields Gold prices typically move inversely to the US dollar, and the latest developments have pushed the dollar to its weakest level since October 2024. Market participants are increasingly pricing in the possibility of a Fed rate cut, as the tariffs could weigh on economic growth.   Additionally, US Treasury yields have plummeted, reflecting growing recession fears. Lower bond yields reduce the opportunity cost of holding non-yielding assets like gold, making it a more attractive investment.         Technical Analysis: Key Levels to Watch Gold’s recent rally has pushed it into overbought territory, with the Relative Strength Index (RSI) above 70. This indicates a potential short-term pullback before the uptrend resumes. The immediate support level lies at $3,115, aligning with the Asian session low. A further decline could bring gold towards the $3,100 psychological level, which has previously acted as a strong support zone. Below this, the $3,076–$3,057 region represents a critical weekly support range where buyers may re-enter the market. In the event of a more significant correction, $3,000 stands as a major psychological floor.   On the upside, gold faces immediate resistance at $3,149. A break above this level could signal renewed bullish momentum, potentially leading to a retest of the record high at $3,167. If bullish momentum persists, the next target is the $3,200 psychological barrier, which could pave the way for further gains. Despite the recent pullback, the broader trend remains bullish, with dips likely to be viewed as buying opportunities.   Looking Ahead: Non-Farm Payrolls and Fed Policy Traders are closely monitoring Friday’s US non-farm payrolls (NFP) report, which could provide critical insights into the Federal Reserve’s next policy moves. A weaker-than-expected jobs report may strengthen expectations for an interest rate cut, further boosting gold prices.   Other key economic data releases, such as jobless claims and the ISM Services PMI, may also impact market sentiment in the short term. However, with rising geopolitical uncertainties, trade tensions, and a weakening US dollar, gold’s safe-haven appeal remains strong.   Conclusion: While short-term profit-taking may trigger minor corrections, gold’s long-term outlook remains bullish. As global trade tensions mount and the Federal Reserve leans toward a more accommodative stance, gold could see further gains in the months ahead.   Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report.   Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news.   Andria Pichidi HFMarkets   Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in Leveraged Products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • AMZN Amazon stock, nice buying at the 187.26 triple+ support area at https://stockconsultant.com/?AMZN
    • DELL Dell Technologies stock, good day moving higher off the 90.99 double support area, from Stocks to Watch at https://stockconsultant.com/?DELL
    • MCK Mckesson stock, nice trend and continuation breakout at https://stockconsultant.com/?MCK
    • lmfx just officially launched their own LMGX token, Im planning to grab a couple of hundred and maybe have the option to stake them. 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.