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

  #471 (permalink)
 
SMCJB's Avatar
 SMCJB 
Houston TX
Legendary Market Wizard
 
Experience: Advanced
Platform: TT and Stellar
Broker: Advantage Futures
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,049 since Dec 2013
Thanks Given: 4,386
Thanks Received: 10,206


vmodus View Post
@SMCJB, in short, assuming I'm understanding your question, yes.

I forgot to provide the Bollinger Band parameters: 38 length.

So the parameters in MC should be the same in TS:
  • BollingerPrice: Indicator: "Mov Avg Adaptive" plot1 | Price = close | EffRatioLength = 10 | FastAvgLength = 2 | SlowAvgLength = 30
  • TestPriceUBand: Indicator: "Mov Avg Adaptive" plot1 | Price = close | EffRatioLength = 10 | FastAvgLength = 2 | SlowAvgLength = 30
  • TestPriceLBand: Indicator: "Mov Avg Adaptive" plot1 | Price = close | EffRatioLength = 10 | FastAvgLength = 2 | SlowAvgLength = 30
  • Length: 38
  • NumDevsUp: 3
  • NumDevsDn: -3
  • Displace: 0

Given that your moving average is adaptive ie trying to detect when the market is even different states, did you ever consider making your Bollinger bands interactive as well?

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
32 thanks
Just another trading journal: PA, Wyckoff & Trends
26 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
19 thanks
  #472 (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


SMCJB View Post
Given that your moving average is adaptive ie trying to detect when the market is even different states, did you ever consider making your Bollinger bands interactive as well?

@SMCJB, how do you mean interactive? Since the AMA is designed to adapt to shifts in market regime and it is used for the Bollinger moving average plus the upper and lower bands, I'm not sure what else I can do. Let me know what you're thinking and I'll see what I can do with it.

~vmodus

Enjoy everything!
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #473 (permalink)
 
SMCJB's Avatar
 SMCJB 
Houston TX
Legendary Market Wizard
 
Experience: Advanced
Platform: TT and Stellar
Broker: Advantage Futures
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,049 since Dec 2013
Thanks Given: 4,386
Thanks Received: 10,206


Traditionally Bollinger Bands would be
 
Code
SMA(X) +/- 2 * StdDev(X)
where X is the lookback period.

I'm saying since you are replacing the fixed length SMA with the Kaufman Adaptive Moving Average did you ever consider replacing the lookback of the StdDev bands in a similar way rather than having a fixed 38 period length. ie have an adaptive StdDev lookback parameter as well.

Reply With Quote
Thanked by:
  #474 (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,168 since Jan 2013
Thanks Given: 57,457
Thanks Received: 26,278


SMCJB View Post
Is the standard deviation calculation of the Bollinger Bands adaptive (ie using the same time period of the KAMA) as well?


SMCJB View Post
Traditionally Bollinger Bands would be
 
Code
SMA(X) +/- 2 * StdDev(X)
where X is the lookback period.

I'm saying since you are replacing the fixed length SMA with the Kaufman Adaptive Moving Average did you ever consider replacing the lookback of the StdDev bands in a similar way rather than having a fixed 38 period length. ie have an adaptive StdDev lookback parameter as well.

I was going to raise the same question the other day, but couldn't quite think how to ask it. This restatement by @SMCJB is more what I was reaching for, I think.

Let me try to say it a little differently, as far as I understand the question.

It would be no problem to plot the adaptive average and then offset it by x number of standard deviations, computing the standard deviation the normal way, which simply uses a regular simple moving average. This may be what you're doing, and it may be the way to go. Standard deviation is a statistical concept, and using the normal simple average calculation may be the only way that it means anything.

But the adaptive moving "average" is not exactly an average -- it's essentially an exponential ma with its smoothing constant dependent on a measure of volatility (I don't remember how Kaufman does it, but that's the idea for all of these adaptive averages, I believe.) The result is that in times when not much is happening, the smoothing constant is close to that of a long-term EMA, so it doesn't change much -- it looks like a slow average. When price moves strongly, the constant is that of a shorter EMA, so it moves quickly -- it moves like a fast average. It's adaptive.

That means that it doesn't actually have a true average period, like a regular average does. What you might call the effective period is variable. (I know you set its length as a parameter, but I don't want to get into that right now. I'd have to look up the details of the KAMA, and I'm feeling lazy.)

So I think I understand @SMCJB -- do you make the effective length of the standard deviation adaptive in the same way as the KAMA, or is it a fixed period of a simple average, as in the usual calculation? Maybe that isn't what he meant, and maybe it doesn't make sense, but I think it's the question.

PS, I wouldn't want to do that, myself, because I think it would require going into the calculation of the standard deviation with the same kind of calculation as the adaptive MA, and I'm not sure exactly what that would mean, in statistical terms.

I hope this was clear and not muddled. If the answer is something like, "No, and why would anyone do that, anyway?", I would understand.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
Thanked by:
  #475 (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

@bobwest, @SMCJB thanks for the input and clarification. Yeah, I see what you're saying. The short answer is no I am not, but I will think about this over the next day or two to clarify my thinking and understanding around this. For this system, since I publish on the 31st, I will stick with what I have, but I will note this as a variation of the idea. I have barely worked with B-bands, so I am having to re-familiarize myself with the calculations. I am thinking the slow period for the KAMA would be 38 (rather than 30), but I'll have to return to this. As-is, the Bollinger SD +/- is calculated from the Bollinger MA (38-bar), i.e. the KAMA (10 Efficiency, 2 fast, 30 slow).

I'll post what I come up with and will probably do a compare and contrast.

~vmodus

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

Here is another teaser as I get closer to finalizing this system idea. Here is more detailed explanation of what I am trying to do with using the 2-period RSI to time my entry:



In the image above, the price closes under the lower Bollinger band, indicating a short entry (or reverse from long). However, we wait patiently for price to come out of oversold. In this example, our entry is $.09 better. Since this is a stop-and-reverse system, the benefit is actually $.18, since we exit our long position at a better price while simultaneously entering in the other direction at better price. There will be slippage (I oversimplified here), but it still provides an improvement, at least in my limited testing. Sometimes it doesn't work, so we just have to take it as comes along. I hope to do a compare and contrast of both methods over backtesting of 18 instruments.

To be continued...

~vmodus

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

Just a couple quick notes for this morning. Firstly, I did a little testing of the 2-period RSI delayed entry idea on a single equity, and it was horrible. Almost every entry was worse, though that might have been the nature of the instrument (it in slow decline over many years).

Secondly, and this is for @SMCJB and @bobwest, I tried Bollinger bands with a 38-period KAMA and it was practically identical to the 30-period. Apparently that amount of smoothing over that length of time did not really move the lines in any significant way. Lots and lots and lots of smoothing (averages of averages).

I wrote my code last night so I am on to my unit testing phase for this idea, where I see if the code actually works. Here is a diagram of the system:

SAT-031 Another Oddball 1


I am not sure if this makes sense to anyone else, but this is how it flows. There is other procedure code to handle other things (variables, stops, etc.), but they don't add anything to this.

~vmodus

Enjoy everything!
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #478 (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, it was fun while it lasted. I was able to run though my testing quickly, though there were some bugs to resolve. All-in-all, it is a pretty simple system.

The ETF's I am using are just weird, which is not surprising since they are derivative and blended. Anyhow, I incubated this system from 2010-2020, and it did not meet the profit factor (1.5) that I use as my first criteria for success:

Overall:


Some metrics for individual ETF's:


One final piece of analysis, to answer the question: Did using the 2-period RSI, as described in earlier posts, improve our entries? As I had hypothesized, it did perform better, as show here with all trades through today (Mar 29, 2022):



This is an important finding and something that we should consider using for breakout or trend-following systems. It sometimes fails, but on the whole it appears to work well with at least some instruments. The thing I liked best is that when going into consolidation/range, the entries were always more favorable: a little higher price on a short; lower price on a long. I know that is where we can struggle a lot with watching profits get eaten up during a consolidation phase, especially a prolonged one.

In summary, this oddball idea fails. Whether it would work with pure futures instruments remains to be seen, but using commodity ETF's as a proxy did not work. I will be publishing my full analysis on Thursday.

~vmodus

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

My post is live...

Trading Idea #031 Another Oddball 1

It was another failed idea, but the RSI delayed entry was a gem. I showed the results to my wife last night, who has worked extensively with Parabolic SAR and Super Trend, and she has tried this idea a long time ago, but it did not work for her. However, she was using longer a longer lookback period (14 bar). I guess it was not an original idea.

If you think about the RSI delayed entry, it is just applying a mean-reversion idea to the entry component of the system. So, in a way, this is a trend-following system with mean reversion.

The system may have failed because of trying to use ETF's as proxies for the futures, though it might have failed anyhow. I suspect that reinvesting all net profits back into the system is a bad idea. I did some testing on a similar system a few weeks ago and played with reinvestment of a fraction of net profits. 100% reinvestment was usually bad (bell shaped equity curve), 50% was optimal, though riskier, and 35% was conservative, but still better than no reinvestment or 100% reinvestment. The reinvestment of net profit causes the bets get to be so large that the losses are outsized, especially during high volatility periods.

Next system: Turtle Soup

~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