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

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

Well, I have been digging deeper into why the DevStop was so hyper-sensitive and I think my implementation of the DevStop was a little different than Kase intended. I followed her formula, but I think I was confused on her 'TRD' calculation. She refers to 'two bars', which to me means the last two bars. To her, it means 2 * True Range (2 times True Range). I discovered this while looking at Perry Kaufman's code for DevStop and comparing to my own. This could explain why DevStop was crap every time I integrated it into a strategy.



Anyhow, I think I have it straightened, but now I have to throw out my analysis. I will post an updated version.

To be continued.......

~vmodus

Enjoy everything!
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?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
77 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
37 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
17 thanks
  #352 (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

As punishment for forking up the DevStop calculations, I redid my 'first week of August' calculations as penance (on a Friday night when I should be relaxing).

At risk of repeating myself.....I used identical entries (PSAR), and pitted PSAR exits against Kase DevStop 1, 2 and 3. (1, 2.2, 3.6 standard deviations) for exits, assuming the use of stop and limit orders for our trailing stops. (Notes: I used 13 bars for calculating the DevStop; Kaufman uses 20 in his code; Kase does not specify in her article how many bars to use; my original calculations yesterday were 2 bars).

Before I share the results, the DevStop stops are set like this, at the closing of each bar:
  • Long positions: Take the DevStop number - High = your stop price
  • Short positions: Take the DevStop number + Low = your stop price
The 1,2,3 levels are used for scaling out of a position (you are supposed to start with contracts in multiples of 3). You can read Kase's article for more details on calculations and usage.

Results:
  • 23 trades for PSAR exits (and reentries) and only 16 trades for each of the DevStops, due to DevStop holding positions longer
  • PSAR stops fared worse against the DevStops
  • DevStop1 was the best of the bunch, which means tighter stops worked best
Cumulative P/L for Each


Conclusion?
DevStop did better, though strangely DevStop2 was the worst. This was a small sample on a crappy week, by design, so I won't read to much into these results. DevStop does bear looking into deeper, and I believe I have a couple of uses for it in at least two of my systems.

One other item of note, and maybe just of interest to me, is that using the 3 contract model, DevStop would have given a 29% improvement over just PSAR exits. But I think most people know, PSAR exits can suck.

Next Steps:
I will code the DevStop for exits and profit taking, where I will be able do testing on much larger samples of data.

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

That's it! Have a great weekend everyone, stay safe and I'll see you on the other side (of Sunday).

~vmodus

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


Not much new to report, as I'm busy all around on various activities. This is what I'm looking at this week. I created an indicator using the Kase DevStop calculations, to help me do stop order placement while I test various ideas for possible strategy development and automation. It kind of looks like a Mexican dancer's dress and makes the chart a very busy place, but it works for what I need.



I coded an exit strategy using DevStops over the weekend, which works well. I have not integrated into any strategy, but I am trying to see what is a good fit.

That's all for now. I will probably report more on Friday.

~vmodus

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

Wow, I cannot believe it is hump day already! Here is what I am looking at this week:

Parabolic SAR with DevStops


I am looking at the usability of the DevStops with various entries. Right now, I am looking at Parabolic SAR for entries and DevStops for stops/exits. Another thing, following what Cynthia Kase does, is using DevStops to scale out of a position. The idea is:
  • On entry signal, buy/sell short in multiples of 3 (i.e., buy 3 contracts...)
  • Exit 1 contract on DevStop 1
  • Exit 1 contract on DevStop 2
  • Exit 1 contract on DevStop 3
I need to code this scaling idea and put it to the test, but it is interesting, if only from an academic standpoint. It may just be a wash. Holding onto that last contract is a double-edged sword: you can avoid serious whipsaw and catch a big upside, or you can get caught on a major reversal. I've seen it go both ways. Again... maybe a wash.

I am currently looking at gasoline (RB), copper, micro ES, EC, and forex (USD-EUR pair).

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

DevStop Calculation Confusion
My earlier confusion with how to calculate and use DevStops originates with Perry Kaufman's Trading Systems and Methods, 6e and Kase's article ( Setting Stop Losses Using Price Volatility.

With all due respect to Kaufman (and I have a deep respect), I do not think the calculation he uses is correct. I was able to track down his source (he is diligent in his citations and sources), and I am guessing whomever coded it did not interpret Kase correctly, unless Kase has changed the calculation. The calculation provided by Kaufman uses Close regardless of trade direction; Kase uses High for short positions and Low for long positions. Kaufman did test it (and provides the EasyLanguage code), so his calculations work.

I have coded both into my indicator, so I can pick which calculation to use. Here is what they look like on a chart (20 bar period, as preferred by Kaufman):



The calculation method may or may not be significant, but the trade results will definitely be different.

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

And speaking of Perry Kaufman...
I caught this podcast last week and I had to share. It is Top Traders Unplugged, which is a podcast about/for systems traders. They had Perry Kaufman on last week, so I thought I would share this: https://www.toptradersunplugged.com/109-the-systematic-investor-series-october-12th-2020-ft-perry-kaufman/. I have listened to this twice.... it was that good. They discuss trend following, position sizing, and a host of other topics. If you have time, I strongly suggest giving it a listen (or two).

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

~vmodus

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

This was a pretty interesting week. First, here is a pretty chart that I'm sharing just for fun. This shows the weekend gap-down in Heating Oil (HO) on March 8th, 2020, with my DevStop indicator applied. It is set at 20 bar calculation, which can be seen with the expansion, and then contraction of the bands. These are 1, 2.2 and 3.6 standard deviations from the mean of the 2x ATR, as described by Cynthia Kase.



Again, that was just for fun.

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

DevStop Experiments
This week was all about DevStop experiments. I have been thinking about the use of standard deviation and other probability/statistical analysis when dealing with price action. There are a few things that I detest:
  1. Time based charts, mainly because they treat a 2am bar on Christmas Eve the same as a 10am bar on Black Monday (or fill in your own black swan hour);
  2. Fixed stop loss amounts, as well as optimizations around stop losses;
  3. Profit targets
With the exception of #3, I use all. I prefer tick based charts, and lately, momentum charts (in some cases), but the downside to that is just the sheer volume and availability of the data. Back-testing on 10 years of tick data is problematic, and I'll leave it at that.

Anyhow, I digressed a little. Working with the DevStops has satisfied the requirement of introducing standard deviation calculations into my trading strategies, and it has helped mitigate some of the problems I have with time-based charts and fixed stop loss amounts. It has also helped refine my exits.

Experiment with Heating Oil:
Question:
Which method works better:
Group 1: 1 contract at a time, with DevStop1 as the exit
Group 2: 3 contracts at a time, exiting at DevStop1, 2, and 3 (scaling out)?

Hypothesis:
I believe that Group 2 will perform better.

Parameters:
  • 20 bar DevStop calculation
  • Trade dates: 11/2/2019 to 11/9/2019; I purposely picked a bad starting date, right at the exhaustion of a large move.
  • 15 minute bars
Rules:
  • Take entry signals: either 1 contract or 3 contracts
  • For Group 1, exit after first DevStop is hit
  • For Group 2, exit after first DevStop, move DevStops 2 and 3 up one level, continue until last contract is exited
  • Repeat
Here are the numbers:


The 'Equivalent P/L' is the P&L if the same number of contracts had been traded for both (36, in this case).

Conclusion:
In this case, Group 2, with the DevStop3, worked better. In most cases, that third contract was the worst performing of the three, but in a couple of cases it did better, because it allows for some retracement before resuming a move. DevStops 2 & 3 also skipped a couple of entries because we were had open positions when the new signals came in. Group 1 had 15 entries; Group 2 had 12 entries.

The sample is small, but I picked a random period of time that started at the end of a large move, so that I didn't start with a really great set of trades. I am more interested in answering the question: how does this perform when the market is ugly?

I hope this made sense. If you have been following along here for the past couple weeks, you should have a good idea what I'm trying to do with the DevStops.

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

I did a bit of paper trading my idea. I can write the strategy, but there are some complexities that I would like to iron out, and I like to see how things play out on a chart. It is easier to code a strategy when I can answer all of the questions that may come up (e.g. what do I do if DevStop1 is higher than my long entry price?......answer: don't enter) I did EC, HG, and RB this week, as a balanced portfolio of sorts. Everything was profitable and performed as expected. I also looked at RB from 700-1600 (ET), to see if this is something that could be manually traded, if need be (it can).

I have sampled a number of different instruments, time periods, all with decent results, even going back to various times over the past 10 years. I have found the manual work is very tedious, but necessary. It provides better context and understanding of nuances that I cannot get by just using a brute-force method of strategy development and testing.

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

Well, I have had my fun with my new toy, but I have other stuff to do. That is all for this week. See you on the other side of the break!

~vmodus

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

Happy Monday morning! Well, this week I plan to journal at least every day, as I am going to do something a little different. This week, I am having my two kids do a project related to trading: tracking and graphing turnip prices from the Nintendo Switch game, Animal Crossing New Horizons (ACNH).



Yeah, turnip prices. They call it the stalk market.

All fun aside, ACNH is a very interesting video game that has a lot of free market attributes. The game is open-ended, so there is no real objective, but you visit a sparsely populated island and are encouraged to build a house, interact with other islanders, and of course, buy and sell things. Like in real life. Aside from the 'stalk market', there is a shop where you can buy and sell things. There is a twist: prices of items can fluctuate, based on some supply and demand algorithm the game developers devised. Also, for example, if I purchase a fishing pole, if I try to sell it back, I get less money than I paid. Like in real life. You also can get loans for building or expanding your home and have a bank account (which accrues interest).

I consider this to be a very useful tool for teaching kids about real world micro economics. And it is really freakin' cute. The whole family is playing. There are some macro economic elements at play also, but I won't get into those.

The Stalk Market
Every Sunday, a vendor comes to the island (a runny-nosed little pig), selling turnips (think farmer's market). You can buy them to sell, eat, or give away. You can sell them Monday-Saturday, but they rot if you don't do something with them before the next Sunday. Prices for turnips change twice per day, in the morning and afternoon (ACNH local currency is a 'bell'), and can be found by asking at Nook's Cranny, the island's general store.

If you do an internet search for 'acnh turnip prices', you will find plenty of sites where people have attempted to find price patterns in variations of turnip prices (sound familiar anyone )

Here is a simple one:

ACNH Stalk Market - Turnip Price Patterns

Source: https://www.heypoorplayer.com/2020/04/27/get-turnips-play-stalk-market-animal-crossing-new-horizons/

So my kids will track the prices and I will use this information to make selling decisions throughout the week. We will graph the prices in Excel and I'll post here every afternoon.

Turnip Prices:
Sunday 25-Oct-2020: 93 bells

I think this will give them a better understanding of what mom and dad do for a living. To be continued....

~vmodus

Enjoy everything!
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #357 (permalink)
 
mtzimmer1's Avatar
 mtzimmer1 
Upstate NY
Recovering Method Hopper
 
Experience: Intermediate
Platform: TOS
Broker: TD Ameritrade
Trading: Equities, Treasuries, Gold
Posts: 840 since Dec 2018
Thanks Given: 2,201
Thanks Received: 1,918

Reading that post put a smile on my face. What a fantastic resource to teach kids important concepts in a way that is fun and engaging for them! Thanks for sharing!

-Zimmer

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

Turnip Price Chart
  • Position (long): 100 Turnips
  • Long entry @ 93 bells
  • Daily Open: 84 bells (down)
  • Daily Close: 125 bells (up)
  • Current P/L (unrealized): 3200 bells
Yeah, I'm doing this tongue-in-cheek, but I cannot take myself too seriously.

I decided that I would have my kids trade 100 turnips and decide what to do with them. I'll report how they did with their decisions (scaling out, take the money and run, let profits run, etc.). There is an interesting site ( Turnip Prophet) that provides an estimating tool to help with selling decisions.

To be continued.....

~vmodus

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

This week, I am looking at PSAR entries, specifically three different models, to determine which is the best. This thinking was spawned by the Top Traders Unplugged podcast, specifically episode 110 of the Systematic Investor Series, which came out early last week. You can give a listen here: https://www.toptradersunplugged.com/110-the-systematic-investor-series-october-19th-2020/

Let me start by saying that the hosts are trend followers and are professional traders with decades of experience. One of the hosts mentioned that the third bar after a signal may be the better than taking the first signal. I can see where a delay of a few bars might allow the price to retrace a little, since many entry signals are generated by price action. Since I have been working with Parabolic SAR, I figured I would apply this idea. The main difference for me is that I am looking at this through the lens of a swing trader, so my timeframes are much different. Still, the idea was compelling enough to consider.

Three entry ideas:
  1. Parabolic SAR (PSAR): enter at the PSAR price when direction changes using stop order
  2. Next bar at open: this appears as the 2nd bar after the direction change
  3. 3rd bar at open: this is appears as the 3rd bar after the direction change
Which Entry is Better?


I looked at copper, gasoline and EUR-USD forex pair. Here are the results:


  • # of Favorable Entries: which entry had the best entry price for the signal?
  • Price Difference: the difference between a PSAR entry and each of the other entries (PSAR was, essentially, the 'control')
  • Value Difference: The price difference times the contract value, assuming 1 contract; in the case of EUR-USD, I used a $100k lot size
The next bar at open entry was clearly the best, though the 3rd bar after signal did okay. Each of them blew away the PSAR price for entry. For short-term swing trading using PSAR, the entry choice is clear. I would not, in reality, take all of these entries, as there are other filters to be applied. The point of this exercise was to help me find the most favorable entry for PSAR.

The 3rd bar idea might work for trend following and long term trades, as the difference for a position you are holding for weeks or months may not matter. I'm sure that was the point they were making. It could also have value where you are using those 2 bars to validate the signal.

My bias was with PSAR, so what I thought was better was actually the worst. PSAR had plenty of favorable entries, but this did not mean they added any value over a series of signals. I was thinking that the price needs to penetrate the PSAR value, thus confirming the direction of the move. Wow.... my eyes are wide open now.

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

Turnip prices and chart will be posted later today.

~vmodus

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


Turnip prices for today:



I liquidated my position today and I think the kids will do the same, prices usually peak between now and Thursday, if at all. I made (net) about $1.2 million bells, or as they called me in the game, a bellionnaire. No shortage of puns in this game.

When my kids liquidate, they will net 32,900 bells (100 turnips, $329 profit/turnip), from 9,300 bell risk capital invested.

We'll keep charting daily.

~vmodus

Enjoy everything!
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