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 93,456 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

  #281 (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
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

Ya example "F" is what I was reffering to

Sent using the nexusfi.com mobile app

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
36 thanks
Tao te Trade: way of the WLD
24 thanks
Spoo-nalysis ES e-mini futures S&P 500
21 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #282 (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

I Heart MultiCharts
To wrap up the week, I figured I would throw some love to MultiCharts. The more I use this application, the more I like it. My wife likes to have YouTube and TED talks on while she works. I like to have Chart Playback in MultiCharts running. It is like watching a movie. I will record a short session of playback, maybe next week, to describe what I see with Fractals and Alligators on Renko charts.

As noted earlier this week, MultiCharts Renko bars are more useful for us than TradeStation, mainly because of the 'hide phantom bars' option. One of the potential issues with TradesStation's Renko bars is that if we have an automated strategy, the trading results will probably never match the strategy. What this means is that backtesting is difficult, if not impossible. More on this in a later entry.

What I find with MultiCharts is that it has the best of both Sierra Charts and TradeStation: speed, stability, user interface, and tools. So I heart MultiCharts.

Fractals in MultiCharts
Right now I am struggling with the provided Fractal indicator in MultiCharts. I need to write my own version, as it does not work quite right on Renko Charts. I wanted to do it today, but I had an issue with a client that I really struggled to resolve. This will be my first official foray into PowerLanguage. The EasyLanguage code does not work in MultiCharts, mainly because it uses a function called Vector.

I was able to do some very interesting tests, particularly on Wednesday, which should have been a bad day, but did okay using my Fractal/Alligator combo.

That is all for the week. I will update my progress on the Fractal development once I get to it. Have a great weekend everyone!

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #283 (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


Breakout
I have been working through my fractal-alligator strategy and I had a breakthrough Sunday, with respect to MultiCharts (MC), but then with TradeStation (TS). The cool thing about working with both is that I can develop code in one and port it to the other, for the most part. So I found that the fractal indicator in MC (ABillW_ActiveFractal) is wrong, at least for Renko charts. I found another one called Chaos Fractals, by happenstance, which was a very fortunate thing. Within an hour I was able to validate it against Renko charts in MC, then port the PowerLanguage back to EasyLanguage and test in TS. It worked great!

I then created a function from the indicator, used it in my fractal-alligator, and voila! It worked great, too! I was able to do this all in less than an hour, which was good, because it was Sunday and beautiful outside, and perfect for a day out with the family. And aside from my son nearly breaking his leg, it was a wonderful day.

Below is a chart with fractals, the alligator teeth (green line), and strategy trades. All trades shown below are getting executed as programmed:

Renko on TradeStation with Alligator Teeth and Fractals


Can we trust our indicators?
Going through this, it begs the question (of any platform anywhere): can we trust our indicators/studies? I have three different fractal indicators that give me three different results, at least on Renko charts. I think, after my experience with fractal calculations, that I need to adopt Reagan's approach to Soviet nuclear disarmament: trust, but verify. I think it is a useful exercise to verify the indicators we use. As algo system developers, I think it is doubly important. If nothing else, it allows us to understand the nuances of an indicator. We may even find the occasional edge.

Forward Testing and Equity Curve
Right now, backtesting is useless, since we are almost 6 months into the COVID-19 situation and getting data further back is difficult (Renko is built on ticks). For proper backtesting, we need more data, but historical tick data is pricey, so we have to choose wisely.

Here is the equity curve for ESM20:



Drawdowns are big, with the largest here of about $2k. This is not an ideal equity chart, but shows some of the price volatility we have had recently. NQ looks about the same.

I have been forward testing in sim and comparing the results to my strategy performance reports. I have been able to work out some potential issues. One issue I had was that TradeStation flaked out on me early this morning and got stuck loading data, so a number of trades were missed.

Next Steps
  • Continue forward testing in sim and validating the strategy performance reports against the trades.
  • Test additional bar sizes
  • Test the strategy on Forex in MultiCharts
  • Add EOW and EOD exit criteria (I don't hold positions over the weekend or overnight for this strategy)
I had some bugs that I was able to resolve over the past couple days. There is still a lot of work to do, but progress is being made.

Have a great day!

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #284 (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

Oh yeah, one more thing to do: look into some better exits when the market turns. Kevin Davey has one in his book Entry and Exit Confessions of a Champion Trader, that I think I can adapt to my strategy. It exits after n-bars in the opposite direction. I have my own twist on that idea, but I won't know it until I try it.

That's all!

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #285 (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

Testing and More Testing
I have been juggling client work and strategy development. The main thing I have been working on is my fractal-alligator strategy. At this point of my system development there are a few new things that I want to add, but for now I am incubating this strategy on a number of different instruments (ES, NQ, GC, and SB). Here are a few things that I have learned:
  • A strategy needs to run and be left alone. This may be self-evident, but with TradeStation, it is not necessarily a reality. I have had 4 crashes, mainly when I load a new chart, add an indicator, or strategy. This hosed some of my results.
  • Constant restarts and resets will affect my P&L. I had both positive and negative mistakes.
  • Do not try to correct a missed entry; reset and move on. I made an error that was a -$700 mistake because I tried to correct an entry. The mistake was, thankfully, on paper. Still, I can see these errors in my sim balance, which is useful to know, understand, and improve.
  • Lower timeframes/bar sizes create tons of extra trades; this is also pretty obvious, but what is not as obvious is the end result (see my charts below)
  • I need a checklist for going live with a strategy and maintaining it. All of the errors I made this week are correctable with a process.
Here are a couple of equity curves, if everything had executed perfectly (one is ESU, one is ESM, but the results were close enough across the two contracts). We currently do not optimize any parameters. Note the peak-to-valley drawdowns of $3k-4k or so.

Short Timeframe


Long Timeframe (2 times longer than the one above)


Which is better, shorter or longer timeframe? It is a matter of preference. My partner prefers fewer trades and lower drawdown; I can accept more trades and a larger drawdown. Some Monte Carlo analysis on our walkforward trades should yield some interesting results. This was an unusual week, but it has been an unusual year, too.

Yeah, the curves look lovely, but I know our actual results would have been different. I hate missed opportunity as much as the next person, but I am a big picture kind of guy. I won't trade a half-baked system that has not been fully tested and passes our criteria.

Next Week:
  • Start strategy on Sunday night and let it run, no interruptions;
  • Add EOW code to my strategies;
  • Analyze execution against strategy reports;
  • Analyze historical P/L by entry times (overnight trades have been good this week)

Have a great weekend everyone, and stay safe!

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #286 (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


vmodus View Post
Here are a couple of equity curves, if everything had executed perfectly (one is ESU, one is ESM, but the results were close enough across the two contracts). We currently do not optimize any parameters. Note the peak-to-valley drawdowns of $3k-4k or so.

Short Timeframe


Long Timeframe (2 times longer than the one above)


Which is better, shorter or longer timeframe? It is a matter of preference. My partner prefers fewer trades and lower drawdown; I can accept more trades and a larger drawdown. Some Monte Carlo analysis on our walkforward trades should yield some interesting results. This was an unusual week, but it has been an unusual year, too.

~vmodus

I was thinking about these two equity curves over the past two days and have an additional observation. The shorter timeframe was half of the longer timeframe (factor of 2, if you will), but the number of trades is 4 times greater. So the number of trades was exponentially greater on the shorter timeframe. That is just interesting to me and maybe not significant.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #287 (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

Il buono, il brutto, il cattivo
I setup my strategies to run my fractal-alligator strategy last night in simulation, trading ES, and I had a little bit of the good, the bad and the ugly, in no particular order. The plan was to start the chart data on Sunday, and wait until the first fractal high and low formed before trading. However, even after they formed (in my mind), they did not show on the chart, nor did any trades occur (which is good because the indicator should match the strategy lock-step). I had to include Friday data, which I was trying to prevent, but that fixed it. Apparently the fractal indicator needs a lot of bars. So that idea failed, but now I know what I can and cannot do. That was the ugly.

The purpose for setting up my chart as such was to prevent a phantom bar fills in the case of a market gap, which it did on open. The idea failed, so I will just set my first chart day to be the Friday before.

Il brutto
The bad was that once I fixed that little problem I noticed that my first trade wasn't taken. Since I have a rule to never enter a trade late (i.e. if I miss an entry, too bad, wait for the next signal unless it comes back to my entry price and the signal is still valid). So I missed an $800 win last night. The cause? TradeStation wasn't calculating the strategy on that workspace. There was no reason for it, as I had the same strategy on a different workspace and it was just fine. So I had to shut down TradeStation and restart it. That fixed the problem. But losing an $800 win was annoying.

So the TradeStation fail was bad.

The other bad was a loss on a long-to-short reversal. It was only a temporary pullback, so we gave back more than I would have liked.

Il cattivo
There were several 'goods':
  • The strategy entries matched the sim trades, except where the trades were missed as noted above;
  • Strategy was profitable today, even without that missed trade above;
  • Simulation is matching, within a point (+/- 1), what it should;
  • There were very few trades (5 round trip; one open position at close);
  • It just works.

Those are the good. Hopefully we can add this to our inventory of working strategies. I am currently doing some testing on other instruments and see potential in metals.

~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~

My next experiment will really be analysis. I am going to attempt to do some profit curves with (hopefully) non-correlated instruments. I am trying to apply something I learned about diversification from Kevin Davey's Strategy Factory course, but with our own strategies.

~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~

No pictures today, maybe tomorrow. I expect things to be a bit smoother over the next session. Incubation continues.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #288 (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

Mostly Good
Today was mostly good (when I refer to 'today', I am generally saying from market open, so last night and today). I had another profitable day in simulation, but we are testing this strategy live against the micros and they are performing well. Here is the trading report (ESU20:



Today's results (sim trading):
  • +$1402 closed profit (I know it doesn't match the above report; this is from the broker trade results and has some trades missing from the report)
  • $988 open profit position at close ($697 minimum profit, with my current stop placement)
One of the metrics that I use is the number of winning series versus losing series. A series is how many consecutive wins or losses you have in a row before the next loss or win, in other words, a winning or losing streak. If there is a balance between the Winning Series and Losing Series, and the number of series are distributed about evenly over a large number of trades during backtesting and walk-forward testing, then the strategy has a greater likelihood of success. Here is one example of a strategy I have that meets the criteria:



There are more important metrics than this one, but I have found value in it.

Don't Fix it if it Ain't Broke
I have a little more work to do on this strategy, primarily setting the end of week exit, which is mainly there for backtesting purposes more-so than unattended trading. I would also like to improve the exits, as I noted in an earlier entry. Right now efficiency, which is a measure of the efficiency of an exit or entry, is between -10% to -5% in backtesting, and between -4% and 0% during sim testing. I like for this particular metric to have at at least 10% efficiency. I am almost hesitant to touch it, since it is working and I don't want to break it. At some point, we will have a code freeze, probably sometime this week.

Knowing me, I would break it and all that work would be down the drain. At least my wife/partner keeps me honest on such things. Good thing I backup daily.

Oddities and Execution
One of the reasons for running in sim is to work out any procedural or execution issues. There are some things to think about:
  • How do I set up my chart for trading on Sunday night?
  • How do I deal with phantom orders?
  • What happens if I reload my chart?
  • What happens if TS crashes?
  • What happens if my PC crashes?
  • How do I restart my strategy and ensure it is synchronized?
That is just a sampling, but it is important. These oddities can have a seriously negative impact on trading. Even more importantly, it can nullify an entire test. As noted yesterday, just a simple error setting up the chart could have cost me $800 in missed revenue. Last night I caused two additional buy orders (in my favor at least), because of an incorrect TradeStation setting and my stopping and restarting the strategy a couple times.

So simulation for me is rehearsal and practice, rehearsal and practice. It is one thing to make psychological errors in trading; it is entirely another thing (and frankly unacceptable), to have execution errors. So deliberate practice is what I am doing.

~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~

I fear that the rest of the week will be more of the same. I do not want to start development on any new strategies right now, as I have several tradable strategies. I am spending a bit of time with my kids, holding 'Dad Camp' most days. For now, I will just work with my strategies, continue organizing my office, and wrap up some client activities.

I hope to do some work on combined strategies sometime tomorrow. Check back in for that bit of fun.

See you on the other side of midnight!

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #289 (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

Fistful of Dollars
Yeah, somehow I'm stuck on Sergio Leone references this week. Anyhow, I ran another day of sim for my strategy on ES. It was another successful day, though it gave back a bit in the mid-afternoon. So I'm convinced, with the testing I've been doing in sim and my wife/trading partner has been running it live (different context, but same results), to go live with this on micro e-minis.

Go Live
So yeah, that's it. One of the criteria for us to go live was the matching of the strategy report (perfect world), sim (executed orders in the sim account...not perfect, not ideal), and live orders. We were able to track each of these three and the all follow pretty closely. One of the challenges is that we are using, when it comes down to it, tick-level data. With TradeStation, we only have 6 months of data available. So we had two choices:
  1. Purchase or lease data going further back
  2. Run live with micro e-minis
We went with #2 because we will know, within a dozen trades or so, if our strategy is bunk or not. This is not how we normally roll. We go back 10 years, typically, to verify our strategies are robust over all types of market regimes. For now, the micros are a blessing, because the offer a low risk test bed in a live environment.

I started the strategies and they are now running. I will monitor, but I turned off my status bar. I cannot let myself be swayed by the small movements or the current P/L. I have catastrophic stops set, there is no optimization to be done, just set it and check it once in a while.

End of Week Exits
I finally got around to coding the EOW exits, which are unique for the strategy (I have other EOW exits, but they don't work here). I ran into a bug, I think, but I found a workaround.

When using the Time attribute (this is the bar close time), this piece of logic does not work. The variable Exit_Time might = 1645 or something like that.

This doesn't work:
 
Code
If Time >= Exit_Time then...
This works:
 
Code
If Time >= 1645 then...
And this works:
 
Code
If Exit_Time <= Time then...
WTF? It makes no sense, thus I think it is a bug. Whatever, I coded around it and now it works with the variable. So that was annoying.

~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~

I have something I want to post tomorrow, if possible. It feels like Thursday, but it's only Wednesday. Have a good night y'all.

~vmodus

WTF = What The Freak, according to my son.

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #290 (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


Go Live
I went live last night with my latest strategy and all went as expected. I don't discuss actual P&L, so I think it is fair to just indicate if my strategy was profitable/not profitable for the day, and overall for the week.

Today's Results (live)
  • Positive P&L at close, trading MES and MNQ (1 contract each)
  • One open position in the green at close
  • 33 round trip trades
  • 39% profitable
  • Overall profit factor 1.29
  • System efficiency: 3% (better than testing)
  • Execution errors: zero
It was a good trading day, despite the lower profitability (we track about 48-50%). The best part: my system was full auto, no intervention required, no crashes, etc. The large number of trades

The Bad
I noticed on one of my trades that there was a some slippage of a few ticks. It was a one-time thing and did not affect overall performance, but I will keep an eye out for this. For the most part, slippage is almost a non-factor due to the use of stop orders (I have some positive slippage, too), though I always include it in my testing.

The other bad, which is not really bad, but not ideal either, is that I'm trading MNQ and MES at the same time, so there is a lot of correlation. My data package is pretty limited, but I will expand it in July and thus the instruments I can trade. I will likely look at micro gold and micro CL as a couple of candidates.

~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~

I worked a little on portfolio diversification today. It is very strange... I never thought I would be at this point. As I figured it, I would run a strategy or two on a favorite instrument, and that would be it. After taking the Strategy Factory course, I realize that I need a basket of instruments and strategies, preferably non-correlated. So my thinking right now is around how we are going to allocate funds to specific instruments and diversify. After a very, very long time and a lot of hard work, it is finally nice to have these kinds of problems.

~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~

Next Steps
Assuming that I can be consistently profitable, I have some goals, both long and short term:
  • Daily goal: Execution is perfect
  • Weekly goal: Positive P&L (on other words, consistent profitability)
  • Monthly goal: cover all costs (data, platform, and fees)
  • Longer term goal: recovery to do from some drawdowns dating back to last year
The account I am trading is actually custodial, so I have a lot of time and flexibility on my hands with this.

~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~

I stumble across this post from Big Mike earlier today: June Charity Fundraiser - Feeding hungry families (2020)

I've seen this kind of thing first-hand before and we have a man on the ground who can make a difference. I appreciate Big Mike's transparency. Donate if you can....

That's all for now. I hope to have the diversification study done by tomorrow. For now, have a great evening everyone!


~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