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: 22nd November 2024.   BTC flirts with $100K, Stocks higher, Eurozone PMI signals recession risk.   Asia & European Sessions:   Geopolitical risks are back in the spotlight on fears of escalation in the Ukraine-Russia after Russia reportedly used a new ICBM to retaliate against Ukraine’s use of US and UK made missiles to attack inside Russia. The markets continue to assess the election results as President-elect Trump fills in his cabinet choices, with the key Treasury Secretary spot still open. The Fed’s rate path continues to be debated with a -25 bp December cut seen as 50-50. Earnings season is coming to an end after mixed reports, though AI remains a major driver. Profit taking and rebalancing into year-end are adding to gyrations too. Wall Street rallied, led by the Dow’s 1.06% broadbased pop. The S&P500 advanced 0.53% and the NASDAQ inched up 0.03%. Asian stocks rose after  Nvidia’s rally. Nikkei added 1% to 38,415.32 after the Tokyo inflation data slowed to 2.3% in October from 2.5% in the prior month, reaching its lowest level since January. The rally was also supported by chip-related stocks tracked Nvidia. Overnight-indexed swaps indicate that it’s certain the Reserve Bank of New Zealand will cut its policy rate by 50 basis points on Nov. 27, with a 22% chance of a 75 basis points reduction. European stocks futures climbed even though German Q3 GDP growth revised down to 0.1% q/q from the 0.2% q/q reported initially. Cryptocurrency market has gained approximately $1 trillion since Trump’s victory in the Nov. 5 election. Recent announcement for the SEC boosted cryptos. Chair Gary Gensler will step down on January 20, the day Trump is set to be inaugurated. Gensler has pushed for more protections for crypto investors. MicroStrategy Inc.’s plans to accelerate purchases of the token, and the debut of options on US Bitcoin ETFs also support this rally. Trump’s transition team has begun discussions on the possibility of creating a new White House position focused on digital asset policy.     Financial Markets Performance: The US Dollar recovered overnight and closed at 107.00. Bitcoin currently at 99,300,  flirting with a run toward the 100,000 level. The EURUSD drifts below 1.05, the GBPUSD dips to June’s bottom at 1.2570, while USDJPY rebounded to 154.94. The AUDNZD spiked to 2-year highs amid speculation the RBNZ will cut the official cash rate by more than 50 bps next week. Oil surged 2.12% to $70.46. Gold spiked to 2,697 after escalation alerts between Russia and Ukraine. Heightened geopolitical tensions drove investors toward safe-haven assets. Gold has surged by 30% this year. Haven demand balanced out the pressure from a strong USD following mixed US labor data. Silver rose 0.9% to 31.38, while palladium increased by 0.9% to 1,040.85 per ounce. Platinum remained unchanged. 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 FX and CFDs 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.
    • A few trending stocks at support BAM MNKD RBBN at https://stockconsultant.com/?MNKD
    • BMBL Bumble stock watch, pull back to 7.94 support area with high trade quality at https://stockconsultant.com/?BMBL
    • LUMN Lumen Technologies stock watch, pull back to 7.43 support area with bullish indicators at https://stockconsultant.com/?LUMN
×
×
  • Create New...

Important Information

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