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,886 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

  #71 (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 have spent some time working out the kinks in my strategy. I now have all of my entries and exits working as intended. I like my strategy, but it doesn't perform well enough for prime-time. It does not pass walk-forward optimization (WFO) and crashes and burns with Monte Carlo simulation. My need to be right does not outweigh my need to practice good money management.

What I like about my strategy:
  • When it catches a good move, it is usually stellar
  • It generally catches trend reversals early
  • It avoids early exits
What I do not like about my strategy:
  • It stays in too long, i.e. my exits stink, and I am giving back way too much. One of the hallmarks of this strategy is it attempts to follow a trend as long as possible without early entry.
  • It enters some 'meh' moves, which I can see on the chart as 'meh', but cannot code around. Most of the losses are on these 'meh' moves;
  • Strategy efficiency is negative, which is due to the issues in the first two points.
I can look at the numbers generated by the strategy, specifically the Confidence Score, and infer some things about when an exit should occur. However, I think I need to add another filter. I dusted off MACD, just for fun and it may have some value. Here is what I'm thinking with the MACD:


In other news, my partner recommended this video on optimization. I want to make sure I'm utilizing best practices:


Next steps:
  • Look at MACD as another possible filter to see if it can be used to avoid meh entries and provide earlier exit signals.
Unless I have some epiphany, this is my last post of the week. Have a great weekend everyone!

~vmodus

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

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
How to apply profiles
Traders Hideout
What broker to use for trading palladium futures
Commodities
 
  #72 (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

So much for my silence until Monday.

I decided to test something against Eurodollar (ED or GE). If you followed this journal or my old journal, you will know that I worked a lot with the VX. I had a killer strategy that absolutely bombed live, because the VX requires limit orders and my orders were not getting filled in a timely manner.

The Eurodollar has been interesting to me since I first started tinkering with futures over twenty years ago. If you don't know much about Eurodollar, the Wikipedia article is a pretty good primer: Eurodollar Futures Contracts. After looking at a chart for the first in forever (sorry Frozen fans), I was reminded of the VX charts.

So I figured, what the hey, let's apply my old VX strategy to this on the 60 minute chart. The results were impressive:


So here is how optimization works in Tradestation, at least how I do it:
  1. Optimize some of the input parameters to a strategy, selecting Walk-Forward as the 'Type'; there must be at least 10,000 combinations (tests) for the WFO to work.
  2. Run the optimization and wait for it to finish
  3. If the results look good (profitable, good win/loss ratio, etc.), then...
  4. Open the WFO tool
  5. Load the optimization file that was created when you ran the optimization
  6. Run the cluster analysis
  7. Evaluate the results (pass/fail)
  8. Run Monte Carlo analysis on one of the tests; I do at least 5000 tests, and will run it several times to verify the results
  9. If it passes Monte Carlo analysis (i.e., it is profitable), then apply the parameters for the best cluster test to unseen data
  10. If the parameters create profitable trades on unseen data, then there is a strong probability that I have a winning system
So for me, a strategy must pass optimization, WFO and Monte Carlo testing to be considered for live trading. This strategy checks all the boxes.

Eurodollar has the volume to support the trading, especially if I restrict my trading to peak hours. Margins are low ($300/contract). The VX strategy has a lot of similarities with the strategy that I've been working on the past couple weeks. I am not going to get too excited, as Eurodollar trading may not be what I expect it to be, as I learned with the VX.

Next steps:
  • Rewrite the VX strategy for market orders
  • Test in sim starting Monday
That's all, for real this time. See you all Monday!

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #73 (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 worked on my Eurodollar strategy/algo over the weekend, primarily doing walk-forward optimization. WFO was successful, so I decided to activate my strategy in sim last night when the markets open. Ideally this strategy will work best from the morning (4am to 8am start) and finish trading by 4pm ET, but I wanted to allow the strategy to run so that I could work out any bugs or other problems.

Problem #1:
The first problem that I found was that my exits were setup wrong in my strategy. I was setting the number of contracts for exit to be the same number as I am trading. Example: I trade 10 contracts, but only 9 contracts get filled by the trade manager. I was trying to exit 10 instead of 9. I think that caused a problem, because the orders looked a little wacky.

Problem #2:
The next problem was that I was having orders rejected because the price was not correct. For this go around, I am using limit orders. I was sending an order like this: buy 10 @ 98.3105. The price was not to the precision allowed by the market. I could enter at 98.31 or 98.315, but no other price between that. I am new to trading this instrument, so that was a good lesson learned.

One thing that annoys me about the Tradestation backtesting engine is that it allows trades on invalid prices, as seen in problem #2. It would be great if it actually identified an invalid price, for example.

I have re-coded my strategy to fix these problems. For problem #1, I just exit the same number that I am currently holding. The second issue required some programming to get the value I want for entry or reversal (rounding to the nearest 5/1000 or 1/100). I wrote a function to handle the heavy lifting, since the rounding functions in Easylanguage are not very robust. The function works well. I have to convert number to text, manipulate it, then convert back to number again.

Next steps:
  • I think the short side of the strategy is at a disadvantage with my calculation, so I will work on that a little more.
  • Run the strategy in sim
  • Do a bunch of other non-trading related tasks that I have to do
This is my only post of the day. Have a great trading day everyone!

~vmodus

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

Good morning friends, colleagues and lurkers! I was able to fix most of my problems with the automated Eurodollar strategy, but we are still in testing it.

I did my regular optimization procedure: optimization, walk-forward optimization, Monte Carlo testing, but this time on a 5 minute chart, specifically the EDZ19. I chose the 5 minute chart because the strategy works (almost) as well on the 5 minute time-frame as the 60 minute. The main reason for the 5 minute timeframe is that I want to get through testing faster, in this case, 12 times faster. The trade-off (no pun intended) is that there is not always the volume to support the number of contracts (10) that I am attempting to trade.

Just for giggles, here is what the EDZ19 chart looks like this morning (I'm short 10 contracts right now):


Since everything passed my testing, I activated my strategy last night and let it run. This morning I woke up and was down about $200. One issue I have is that orders may not get filled, so they are hanging out there and then get picked up later. I'm working with limit orders, so they sit out there until it fills or I cancel them. This is the main reason I'm running a loss. If all orders had been taken, I should be about +$130. After a quick chat with my partner, she said knows how to fix that.

The sim testing process is actually working pretty well. Orders are sent into the queue and the order is 'filled' when it's our turn. The application makes a reasonable assumption about where our order should go in the queue. Sometimes we're filled quickly, other times not.

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

Eurodollar
Since I started working on the Eurodollar, I've learned some very cool things about it. The main thing, and of great importance and value to me, is that there are 4 contract months that have high volume: Dec 2019, Mar 2020, May 2020, and Dec 2020. This volume is high enough to trade one or more of these contract months at one time. This is a huge shift from trading any other contract I've work with (YM, CL, ES, etc.), where most people are only trading the nearest contract month.

This opens a range of new possibilities. I could, conceivably, just trade Dec 2020 for the next year without having to worry about rollover or contract expiration. I could use my strategy and trade a couple of contracts on each of the most active contract months, thus assuring that I am trading the number of contracts I want to trade.

One thing that I will explore is the price relationships between contract months and see what sort of correlation may exist between them. Something caught my eye between the Dec 19 and Dec 20 contract months that I might be able to capitalize upon.

This is going to be fun.

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

VX Revisited
So this strategy is a direct descendant of the strategy I built for the VX last Spring, but which failed when I went live. I am now seeing that some of the code errors that I didn't recognize back then contributed to it's failure. So once I free up some time, I will revisit the VX and see if my code changes fixed some of my issues. I have a fondness for that weird little contract.

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

Next steps:
  • Let the strategy run
  • Clean up any old orders that have accumulated in the Trade Manager
Have a great trading day everyone!

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #75 (permalink)
 
numberjuani's Avatar
 numberjuani 
Agoura Hills, CA USA
 
Experience: Advanced
Platform: Tradestation&Multicharts
Broker: TradeStation
Trading: Futures & Equities
Posts: 128 since Apr 2019
Thanks Given: 9
Thanks Received: 102

Hi @vmodus, I really recommend you take @kevinkdog strategy factory workshop. It has a focus on making sure what you code performs in the real market as it Does in the walk forward and it looks to me like it will save you a lot of time developing and a lot of money testing. I was making many of the same mistakes you’re making here and @kevinkdog cleared them all in the first hour of strategy factory.It’s also geared to TS users and from seeing your strategy here I assure you, you would benefit greatly


Sent using the NexusFi mobile app

Reply With Quote
Thanked by:
  #76 (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


numberjuani View Post
Hi @vmodus, I really recommend you take @kevinkdog strategy factory workshop. It has a focus on making sure what you code performs in the real market as it Does in the walk forward and it looks to me like it will save you a lot of time developing and a lot of money testing. I was making many of the same mistakes you’re making here and @kevinkdog cleared them all in the first hour of strategy factory.It’s also geared to TS users and from seeing your strategy here I assure you, you would benefit greatly

Thanks so much for the advice. I will definitely check it out later today or tomorrow. I've been muddling along and learning as I go, but I love learning from others.

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #77 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,172 since Jan 2013
Thanks Given: 57,514
Thanks Received: 26,292


numberjuani View Post
Hi @vmodus, I really recommend you take @kevinkdog strategy factory workshop. It has a focus on making sure what you code performs in the real market as it Does in the walk forward and it looks to me like it will save you a lot of time developing and a lot of money testing. I was making many of the same mistakes you’re making here and @kevinkdog cleared them all in the first hour of strategy factory.It’s also geared to TS users and from seeing your strategy here I assure you, you would benefit greatly


Sent using the NexusFi mobile app

@kevinkdog is well known on this forum, and has a number of videos and threads on automated trading design and testing here.

He's also got a book out that is well thought-of (I've never even opened it myself because I'm not into automated trading , but people who are seem to like it.) It's on Amazon, I believe. Do an Amazon search for Kevin Davey (his real name) and you should find it.

Edit: I just searched for it myself, and there are four books by him. I think the one that people usually refer to is the expensive one (of course.)

Again, not a plug, just some info you might be able to use.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
Thanked by:
  #78 (permalink)
 
numberjuani's Avatar
 numberjuani 
Agoura Hills, CA USA
 
Experience: Advanced
Platform: Tradestation&Multicharts
Broker: TradeStation
Trading: Futures & Equities
Posts: 128 since Apr 2019
Thanks Given: 9
Thanks Received: 102


vmodus View Post
Thanks so much for the advice. I will definitely check it out later today or tomorrow. I've been muddling along and learning as I go, but I love learning from others.

He won the World Cup of trading using fully automated strategies in TS, and he really adds a lot of value to the class by giving you 7 ready to trade strategies, and phone/email support. You also get access to the "strategy factory club", which means once you get the process and are able to create strategies that meet specific ( very demanding) criteria, you will be able to pool them in with other members verified strategies. For me it was trade-life changing.
Check it out here
https://kjtradingsystems.com/index.html

Reply With Quote
Thanked by:
  #79 (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


numberjuani View Post
He won the World Cup of trading using fully automated strategies in TS, and he really adds a lot of value to the class by giving you 7 ready to trade strategies, and phone/email support. You also get access to the "strategy factory club", which means once you get the process and are able to create strategies that meet specific ( very demanding) criteria, you will be able to pool them in with other members verified strategies. For me it was trade-life changing.
Check it out here https://kjtradingsystems.com/index.html

I looked at his site after you mentioned it the other day and checked out his workshop. I did not realize who @kevindog was until I checked out his website. I'm familiar with his writings and his successes at the World Cup, but did not put two and two together. I'm glad he is a member here.

Thanks again for the advice!

~vmodus

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


When you have a day that is between blah and meh, it's a bleh day. I just made that up.

I didn't have too much time to spend on my strategies yesterday or today, mainly due to client work this week. And this little episode occurred today. I drop my son at school in the morning because it is about 2 minutes from the Y. I use it as an excuse to work out. So when I get home, I grab a bowl of cereal and am happily munching it when a movement catches my eye: one of our hamsters is walking across the floor of our living room. This also caught the attention of our cat, a lean and stealthy hunter who goes by the name 'Chi'. Well, I quickly scoop her up and lock her in our bedroom. Then I had to search for the stupid hamster, which failed. Eventually my wife came back from the Y and we found and caught the little booger. So, that killed about an hour.

Yesterday, I learned something new about the Eurodollar. The tick size varies depending upon which contract you are trading. In brief: the nearest contract month has a tick size of .0025 and all other contract months have a tick size of .005. Since I'm still new to trading over multiple contract months, this was a neat thing to learn.

I wondered why some orders for the Dec 2019 contract (EDZ19) were rejected on Nov 18th, but none rejected on the 19th. Turns out, the November 18th was the expiration date for the November 2019 contract. I use limit orders in the strategy, so I have to send a valid price. So I would send an order at 98.1125, but it would get rejected. I would have to send 98.115 or 98.110. Once the December contract was the nearest, no more rejected orders.

I wrote those changes into my code, so I should not have those issues moving forward. I am following @numberjuani's advice and looking into @kevinkdog's workshop and books. Aside from that, I haven't had any time to work on anything else. Tomorrow I have to travel, so I will not be doing any trading related work. I may post an update tomorrow, but don't hold your breath.

Have a good evening everyone and happy trading Friday!

~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