NexusFi: Find Your Edge


Home Menu

 





Attack of the Robots - An Algo Journal


Discussion in Trading Journals

Updated
      Top Posters
    1. looks_one vmodus with 357 posts (859 thanks)
    2. looks_two SMCJB with 38 posts (84 thanks)
    3. looks_3 kevinkdog with 27 posts (70 thanks)
    4. looks_4 bobwest with 13 posts (53 thanks)
      Best Posters
    1. looks_one bobwest with 4.1 thanks per post
    2. looks_two kevinkdog with 2.6 thanks per post
    3. looks_3 vmodus with 2.4 thanks per post
    4. looks_4 SMCJB with 2.2 thanks per post
    1. trending_up 91,965 views
    2. thumb_up 1,141 thanks given
    3. group 61 followers
    1. forum 478 posts
    2. attach_file 181 attachments




 
Search this Thread

Attack of the Robots - An Algo Journal

  #271 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

Fractals Rebooted

Yesterday I noted an issue with our fractal. We were using the same calculation in this post (the 'Fractal Patterns' code): . This is, unfortunately, an oversimplified version, even if it was provided by Bill Williams. If you want to geek out, it is shown in Trading Chaos 1st ed. p. 147, or Trading Chaos 2nd ed. p. 138.

There may be more than 5 bars involved, and this is where the TradeStation Fractal ShowMe comes into play (ShowMe is a type of indicator that paints things on the screen, like dots, etc.). The correct code, which I verified against the books, is shown later in that post. Not to worry, of course I just took the ShowMe code, created a function.

When I replaced my old fractal calculation with the new (correct) function, it performed about the same, on balance. So now I have the correct fractal calculation, with about the same net results.

There is one thing that I do not have in my fractal alligator strategy, but is a mainstay: exit all positions at end of week. A lot of trades I take are intraday swings and I never trade the daily charts. When working with fractals, I like to reset every new week: wait for the first high and low fractals to establish themselves before starting to trade. This strategy I have been testing does not have the end-of-week criteria, and considering some of the gap downs we have seen in a lot of instruments since February, it has skewed the results.

Regardless, there is plenty to like and dislike from my current approach. No pictures for this entry, sorry about that.


~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
Futures True Range Report
The Elite Circle
 
  #272 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

Getting Better

This is my same Fractal-Alligator strategy, on RTY. Both the equity curve and the efficiency has improved. This is with no optimization and no stop loss:

Equity Curve


Total Efficiency


I like the fact that this requires little to no optimization. I have the option built-in to allow a stop loss, but I have found they don't really improve equity curve very much, based on our entries and exits.

Still more work to do....

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #273 (permalink)
 
Sandpaddict's Avatar
 Sandpaddict 
Vancouver, Canada
 
Experience: Advanced
Platform: Ninjatrader, MT4
Broker: IB, Global Prime
Trading: Futures CFDs
Posts: 684 since Mar 2020
Thanks Given: 975
Thanks Received: 637



vmodus View Post
Fractals Rebooted

Yesterday I noted an issue with our fractal. We were using the same calculation in this post (the 'Fractal Patterns' code): . This is, unfortunately, an oversimplified version, even if it was provided by Bill Williams. If you want to geek out, it is shown in Trading Chaos 1st ed. p. 147, or Trading Chaos 2nd ed. p. 138.

There may be more than 5 bars involved, and this is where the TradeStation Fractal ShowMe comes into play (ShowMe is a type of indicator that paints things on the screen, like dots, etc.). The correct code, which I verified against the books, is shown later in that post. Not to worry, of course I just took the ShowMe code, created a function.

When I replaced my old fractal calculation with the new (correct) function, it performed about the same, on balance. So now I have the correct fractal calculation, with about the same net results.

There is one thing that I do not have in my fractal alligator strategy, but is a mainstay: exit all positions at end of week. A lot of trades I take are intraday swings and I never trade the daily charts. When working with fractals, I like to reset every new week: wait for the first high and low fractals to establish themselves before starting to trade. This strategy I have been testing does not have the end-of-week criteria, and considering some of the gap downs we have seen in a lot of instruments since February, it has skewed the results.

Regardless, there is plenty to like and dislike from my current approach. No pictures for this entry, sorry about that.


~vmodus

Hello vmodus. Not sure if this will help depending on how many trades you take a day... but one the most amazing discoveries I made when, testing mostly breakout strategies, but it worked on alot of strategies as well was exiting EOD. Especially as a good base to test other exits against. Simple but if you run all your entries ect the same but test what the comparison to ending at the EOD and current exits you might be surprised.

Maybe you tried or you know. Not sure.

Just trying to be helpful. Hopefully it's something you can test.

Sent using the nexusfi.com mobile app

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #274 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


Sandpaddict View Post
Hello vmodus. Not sure if this will help depending on how many trades you take a day... but one the most amazing discoveries I made when, testing mostly breakout strategies, but it worked on alot of strategies as well was exiting EOD. Especially as a good base to test other exits against. Simple but if you run all your entries ect the same but test what the comparison to ending at the EOD and current exits you might be surprised.

Maybe you tried or you know. Not sure.

Just trying to be helpful. Hopefully it's something you can test.

Sent using the NexusFi mobile app

Hello Sandpaddict. Thanks for sharing the post, but yeah, I've been there already. We have already used this post as reference, but I have moved on to the calculation in the TradeStation ShowMe, as the simpler calculation (my wife/trading partner uses the older one successfully). I am guessing the older calculation was provided to students of his Profitunity training courses.

In any case, I was testing a strategy for the past 24 hours which had way too many trades. I have to fix the entries and exits, as my logic is messed up, but I have at least a dozen different strategy ideas just from what I've learned and observed from fractals. One thing is certain, up to this point, is that EOD and EOW exits are best. Reset the fractals every new day/week and my strategies track well.

Thanks again!

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #275 (permalink)
 
Sandpaddict's Avatar
 Sandpaddict 
Vancouver, Canada
 
Experience: Advanced
Platform: Ninjatrader, MT4
Broker: IB, Global Prime
Trading: Futures CFDs
Posts: 684 since Mar 2020
Thanks Given: 975
Thanks Received: 637


vmodus View Post
Hello Sandpaddict. Thanks for sharing the post, but yeah, I've been there already. We have already used this post as reference, but I have moved on to the calculation in the TradeStation ShowMe, as the simpler calculation (my wife/trading partner uses the older one successfully). I am guessing the older calculation was provided to students of his Profitunity training courses.

In any case, I was testing a strategy for the past 24 hours which had way too many trades. I have to fix the entries and exits, as my logic is messed up, but I have at least a dozen different strategy ideas just from what I've learned and observed from fractals. One thing is certain, up to this point, is that EOD and EOW exits are best. Reset the fractals every new day/week and my strategies track well.

Thanks again!

~vmodus

Great can't wait to see how it goes. Keep up the good work.

I know what fractals are. Not sure what your referring to. Im guessing its the swings within swings?

Pretty cool you both trade. Anyway good reading.

Thank you vmodus

Sent using the NexusFi mobile app

Visit my NexusFi Trade Journal Reply With Quote
  #276 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


Sandpaddict View Post
Great can't wait to see how it goes. Keep up the good work.

I know what fractals are. Not sure what your referring to. Im guessing its the swings within swings?

Pretty cool you both trade. Anyway good reading.

Thank you vmodus

Sent using the nexusfi.com mobile app

I'm sorry, I wasn't clear. I am referring to the two different calculations in the post you referenced. The Profitunity code only looks at 5 bars. Example:

Profitunity Code


The TradeStation code, which matches the descriptions in Williams' books, will use as many bars as needed to determine if a fractal formed. In the example below, there were two consecutive highs with the same value. So the code needs to look back to additional bars.

TradeStationCode


When my partner started exploring fractals, she used the example in that post (the old code). It worked for her in her strategy, so she stuck with it for that application.

We are moving slowly to MultiCharts, so the TradeStation code won't work, as it uses vectors. MC has their own fractal calculations using swinghigh/swinglow and Pivot functions, so I will have to confirm that they follow the books.

More on fractal adventures later this afternoon.....

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #277 (permalink)
 
Sandpaddict's Avatar
 Sandpaddict 
Vancouver, Canada
 
Experience: Advanced
Platform: Ninjatrader, MT4
Broker: IB, Global Prime
Trading: Futures CFDs
Posts: 684 since Mar 2020
Thanks Given: 975
Thanks Received: 637


vmodus View Post
I'm sorry, I wasn't clear. I am referring to the two different calculations in the post you referenced. The Profitunity code only looks at 5 bars. Example:

Profitunity Code


The TradeStation code, which matches the descriptions in Williams' books, will use as many bars as needed to determine if a fractal formed. In the example below, there were two consecutive highs with the same value. So the code needs to look back to additional bars.

TradeStationCode


When my partner started exploring fractals, she used the example in that post (the old code). It worked for her in her strategy, so she stuck with it for that application.

We are moving slowly to MultiCharts, so the TradeStation code won't work, as it uses vectors. MC has their own fractal calculations using swinghigh/swinglow and Pivot functions, so I will have to confirm that they follow the books.

More on fractal adventures later this afternoon.....

~vmodus

Got it. Makes sense.

Curious. Have you tested the difference counting that as ONE fractal high vs adding more bars behind? Again just curious?

Sent using the nexusfi.com mobile app

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #278 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

Renko Experiments
I have been doing some experiments over the past few days, to see what I could do with Renko charts and Fractals. Renko bars are difficult to work with, algorithmically speaking, but I will not go into that here. We will just pretend we are discretionary traders for the moment.

I wanted to apply the Fractal and Alligator ideas to a Renko chart and see how they performed. Although I have an algo written to do this, I like to do it manually to really get a deep understanding of the process. And the algo isn't bug-free yet.

I took a 23 hour period of both ES and RTY, from Sunday open to Monday close. I used the following Renko settings in TradeStation:
  • ES: 1.25 / tick
  • RTY: .5 / tick
ES did well for the day (+$1095 after commission and slippage), but RTY was a mess (-$55 net; but 82 trades ). Even though both are essentially set to 5 tick bar sizes, RTY had at least 8 times the number of fractal signals. Widening the bar helped somewhat, but it was still all over the place.

Next Experiment
We have been playing quite a bit with MultiCharts, so I wanted to spend a little more time getting acquainted. So I decided to take ES and do the same manual analysis, but using MultiCharts' fractal.

Why do an experiment? MultiCharts has one distinct advantage over TradeStation (well.... more than one, but let's not go there): Renko bars can be rendered with no synthetic or 'phantom' data/bars (if you like them, you can enable them). TradeStation has no such option. Cynthia Kase makes a great argument against Range Bars for the same reason, preferring her own home-brew Kase bars based on ATR. The two charts below are from the same time period:

TradeStation - Phantom Bars


MultiCharts - No Phantom Bars


The advantage is useful in backtesting, etc., but I will not get into details or discussion regarding Renko and automation. That is a whole different set of posts. Again, we are pretending we are discretionary traders.

A refresher on the rules:
Long:
- Fractal High > all Alligator lines
- Price breaks through Fractal High price

Short:
- Fractal Low < all alligator lines
- Price breaks through Fractal Low price

$30 per round trip for slippage and commission; no stop loss or profit target

The differences between the two were very, very interesting. MultiCharts fractals are not perfect, and I will have to recode them myself. But here are the results of the two systems:

ES Fractals and Alligators - MultiCharts versus TradeStation


I expected maybe a 10% variance. I got a 100% variance, MultiCharts over TradeStation. One less trade on MultiCharts. I don't know why the difference is so great. but as my partner tests her own strategies on MC versus TS, she is seeing similar things. It may have to do with the phantom bars (there was only one gap yesterday, as seen above). In fact, as I write this, it may very well be that, due to bar building......

Enough for now. I have some client work to catch up on. See you on the other side of tonight!


~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #279 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


Sandpaddict View Post
Got it. Makes sense.

Curious. Have you tested the difference counting that as ONE fractal high vs adding more bars behind? Again just curious?

Sent using the nexusfi.com mobile app

Sorry, I missed your question the other day. Just using Fractal High (for simplicity), the rules state that the high must be followed by two lower highs. If you have two or more highs that are equal, then you only consider the latest high. So you need two bars before the fractal high with lower highs and two bars after the fractal high with lower highs. Here are a few examples from Trading Chaos, 1 ed. (excuse the crappy scans):

Initiating Fractals


A: Fractal High
B: Fractal High and Low occurring on the same bar
C: Fractal High followed by a Fractal Low
D: Fractal High followed by an equal high

Fractal Examples


I like your questions. It helps my understand the process more if I can explain it to someone else (even better if they understand ).

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #280 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


RTY with Renko
Although I have been busy juggling client and trading work, I had a little time to do some analysis on RTY, similar to what I did yesterday with ES. I took a 23 hour period, but this time I used a 10 tick brick size (or 1 brick size, in TradeStation, against the same period as ES (Sunday open to Monday close).

Here is what I got, using the same entry and exit rule, no stop loss or profit target, and $25 slippage and commission (roundtrip):

RTY Renko 10 tick bar - TradeStation versus MultiCharts


I don't know what this means. -$10 versus $3700? WTF? I really don't know what it means. I'm not excited, I'm just confused here.

Next steps on this idea:
  • Compare TradeStation bars with MultiCharts bars and how they may vary;
  • Update my TradeStation strategy to match what I have been doing manually;
  • Convert this strategy to MultiCharts and see what I can do with it.

The big challenge will be understanding how to code this in PowerLanguage, MultiCharts development language. The fractal indicator doesn't work properly (at least for Renko charts) and the functions it calls, as noted yesterday, don't quite work. As it usually goes, I will probably have a breakthrough on Friday and have to wait all weekend to until I can full test my idea.

Anyhow, more work to be done.


~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:




Last Updated on March 31, 2022


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts