NexusFi: Find Your Edge


Home Menu

 





MedSchoolTrader's Automated Trading Journey


Discussion in Trading Journals

Updated
      Top Posters
    1. looks_one MedSchoolTrader with 3 posts (7 thanks)
    2. looks_two Futuresnoob with 2 posts (1 thanks)
    3. looks_3 Liquidity Taker with 1 posts (0 thanks)
    4. looks_4 dstrader with 1 posts (2 thanks)
      Best Posters
    1. looks_one MedSchoolTrader with 2.3 thanks per post
    2. looks_two dstrader with 2 thanks per post
    3. looks_3 jackbravo with 1 thanks per post
    4. looks_4 Futuresnoob with 0.5 thanks per post
    1. trending_up 1,719 views
    2. thumb_up 11 thanks given
    3. group 9 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

MedSchoolTrader's Automated Trading Journey

  #1 (permalink)
 
MedSchoolTrader's Avatar
 MedSchoolTrader 
San Antonio, TX
 
Experience: Beginner
Platform: NinjaTrader 8
Broker: NinjaTrader Brokerage (Continuum Data Feed)
Trading: ES, YM, NQ
Posts: 3 since Jul 2017
Thanks Given: 3
Thanks Received: 7

Hey all,

First post on the forums! I am excited to get more involved here, and so I'll kick this off by introducing my first trading journal on futures.io.

After discretionary day-trading the YM and NQ futures contracts for the past few months with some small funds, I've lost $1.5k. Most of that loss was early on while going through the novice trader phase of learning how to actually follow the rules. Now I have gone breakeven, back and forth, for the past couple months despite focusing on education.

I've recently looked into automated strategies. I used to code before coming to medical school, and I love mathematics and searching for patterns. So I read a few books and will be "incubating" a strategy I wrote coalescing aspects of other people's strategies on this forum and across the web.

I've devised and coded a strategy called "NQRenkoScalper."
Timeframe: intra-day
Type: short-term trend following
Contract: NQ futures
Quantity: 2, with different exit parameters for each
Max stop loss per trade: ~$200, although it frequently moves to breakeven
Profit target: none explicitly; exits on weakness - will follow a strong trend to infinity


I did walk-forward analysis to establish best indicator inputs for entry and screening out chop. Then, I tested performance on the most recent, unused data I had, January 2017 - September 2017. I utilized NinjaTrader 8's high order fill resolution using tick data and set slippage assumptions to 2 ticks, as I both enter and exit exclusively with market orders.



Overview
The strategy trades two contracts, and I like the net profit of $3,833.36. Profit factor was 2.66, which I consider too good. I'm testing on data not used for optimization, but still worried about curve-fitting. Max drawdown was -$1,502.36, which for my already-depleted small account is worrisome. Over 9 months, the strategy placed 76 total trades, averaging 0.44 trades per day. My largest winner was $761.36, attributable to the trend-following nature of my strategy. Largest loser was -$183.64. I averaged $175.50 on wins and -$56.32 on losers.



Equity Curve
Nine-month equity curve is shown. The strategy stays completely profitable from the start date of January 1, 2017. However, if trading began around May, peak drawdown would have occurred, creating an initial ~1.5k net loss (red arrow) before the August rebound.

Monte Carlo
Monte Carlo analysis (not shown) shows if trades were randomized in order, the above predicted max drawdown is likely an outlier, with median Monte Carlo max drawdown around -$640 and best-case max drawdown up near -$200. Other results from Monte Carlo show net profit is likely accurate, with peak median net profit after trade randomizations to be around $3,600, with worst-case around $1,800 and best-case up near $7500.

Plan
Starting October 1st, my strategy will run live on a simulated account until February 1st. This is "incubation," which will allow me to sit on the trading idea and set up a more objective evaluation in February before I decide on the strategy's validity. I will examine strategy performance on the 1st of each month and report back here with results. By November 1st, I will also set up comparison strategies with the same code except one that enters randomly, one that exits randomly, and one that both enters and exits randomly. I will use these strategies' performances to further compare to NQRenkoScalper's to ensure I am thoroughly analyzing performance.

Let's see how this goes

Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
How to apply profiles
Traders Hideout
Quant vue
Trading Reviews and Vendors
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #3 (permalink)
 
jackbravo's Avatar
 jackbravo 
SF, CA/USA
 
Experience: Beginner
Platform: SC
Broker: Stage 5
Trading: NQ...uh..ES actually
Posts: 1,337 since Jun 2014
Thanks Given: 4,362
Thanks Received: 2,400


Cool!

"It does not matter how slowly you go, as long as you do not stop." Confucius
Reply With Quote
Thanked by:
  #4 (permalink)
 Futuresnoob 
San Antonio Texas
 
Experience: Intermediate
Platform: Sierra Charts, TOS
Broker: Edge Clear, Rithmic
Trading: ES and Treasury Spreads
Posts: 102 since Nov 2016
Thanks Given: 50
Thanks Received: 55

That raises a question that I had. If you do get a successful automation strategy to run, how long should you let it run in a simulated mode Before deciding on the results and trading it live? How did you determine your Runtime?

Sent using the NexusFi mobile app

Reply With Quote
  #5 (permalink)
 Futuresnoob 
San Antonio Texas
 
Experience: Intermediate
Platform: Sierra Charts, TOS
Broker: Edge Clear, Rithmic
Trading: ES and Treasury Spreads
Posts: 102 since Nov 2016
Thanks Given: 50
Thanks Received: 55

Oh and congratulations on developing your system!

Sent using the NexusFi mobile app

Reply With Quote
Thanked by:
  #6 (permalink)
 
MedSchoolTrader's Avatar
 MedSchoolTrader 
San Antonio, TX
 
Experience: Beginner
Platform: NinjaTrader 8
Broker: NinjaTrader Brokerage (Continuum Data Feed)
Trading: ES, YM, NQ
Posts: 3 since Jul 2017
Thanks Given: 3
Thanks Received: 7


Futuresnoob View Post
That raises a question that I had. If you do get a successful automation strategy to run, how long should you let it run in a simulated mode Before deciding on the results and trading it live? How did you determine your Runtime?

Sent using the NexusFi mobile app

I am definitely no expert, but I chose 3 months because
1) I considered it long enough to get over 30+ trades on my system to be able to do statistical tests (which usually require n=30 or higher) and,
2) I am not so concerned that if I do have a "trading edge" with this system, that it will be gone in 3 months. If I chose a year or two years, any edge I have in this system has a higher probability of being invalid after that time.

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
 
Liquidity Taker's Avatar
 Liquidity Taker 
Plymouth, Michigan
 
Experience: Master
Platform: NT, TS
Broker: Ninja, TradeStation
Trading: ES
Posts: 61 since Aug 2009
Thanks Given: 5
Thanks Received: 41

That sounds like a very small sample size


Sent from my iPhone using futures.io

Follow me on Twitter Reply With Quote
  #8 (permalink)
hagenaer
San Francisco, CA
 
Posts: 1 since Aug 2017
Thanks Given: 1
Thanks Received: 0

Very cool!

I'm building strategies for automation as well. It sounds like you're coding them directly, or do you use a platform/software to do this? I'm using SharkIndicators Bloodhound inside NinjaTrader 7 (it only works in 7), which is quite easy in their visual logic builder.

How do you do your backtesting? Bloodhound offers a backtesting option, but I've noticed that applying a strategy to a static chart (historical) has very little to do with running it on a live market. For example, I built a quick strategy that showed a 12+ profit factor using the backtesting option, but when tracking the live market it was only marginally profitable and very inconsistent (big wins and big losses). So now I either run them in sim on the live market, or I do market replay at increased speeds. That has shown to be pretty reliable for testing performance.

I'm most curious to hear (if you don't mind sharing that, I'd understand if you don't) how you've solved for avoiding a choppy market without also missing the good opportunities. It's the part I'm struggling with currently.

Anyways, thanks for sharing!

Reply With Quote
  #9 (permalink)
 dstrader 
Chicago, USA
 
Experience: Advanced
Platform: TS, NT, TOS, SSE, IRT
Trading: ES, currency futures, options, stocks
Posts: 195 since Dec 2010
Thanks Given: 330
Thanks Received: 275

Strategy Analyzer (SA) is almost useless with custom bars (and in general to be honest). I use SA is a very limited fashion, maybe to find which moving average value may work best in a strategy set up for example. But I never trust the data fully until I go to the next step below.

Make sure you download historical data for a month or two and run the strategy with Market Replay. I bet your results will be quite worse unfortunately. The strategy may become unstable if you run for long periods of time, so you may want to break the backtest a week at a time, and load your results in a spreadsheet.

After you get a PF of 2.00 or more with Market Replay I would run the strategy against live data for a couple of months. If your PF is still above 2.00 you can consider starting a small account and see how the strategy performs in a live environment.

Good luck!

Reply With Quote
Thanked by:
  #10 (permalink)
 
MedSchoolTrader's Avatar
 MedSchoolTrader 
San Antonio, TX
 
Experience: Beginner
Platform: NinjaTrader 8
Broker: NinjaTrader Brokerage (Continuum Data Feed)
Trading: ES, YM, NQ
Posts: 3 since Jul 2017
Thanks Given: 3
Thanks Received: 7



hagenaer View Post
Very cool!

I'm building strategies for automation as well. It sounds like you're coding them directly, or do you use a platform/software to do this? I'm using SharkIndicators Bloodhound inside NinjaTrader 7 (it only works in 7), which is quite easy in their visual logic builder.

How do you do your backtesting? Bloodhound offers a backtesting option, but I've noticed that applying a strategy to a static chart (historical) has very little to do with running it on a live market. For example, I built a quick strategy that showed a 12+ profit factor using the backtesting option, but when tracking the live market it was only marginally profitable and very inconsistent (big wins and big losses). So now I either run them in sim on the live market, or I do market replay at increased speeds. That has shown to be pretty reliable for testing performance.

I'm most curious to hear (if you don't mind sharing that, I'd understand if you don't) how you've solved for avoiding a choppy market without also missing the good opportunities. It's the part I'm struggling with currently.

Anyways, thanks for sharing!

With backtesting, it makes assumptions about order fills that can easily drive up profit factor. If you use limit orders, backtest often assumes that you will get filled when the limit price is touched - not very accurate. Usually you'll want to script in custom logic that order is filled only after one tick past your limit price.

If you use market orders, you need to build in slippage. Without slippage, backtester assumes that you get filled at a favorable price on market orders, which usually you need to jump across the bid/ask to get a fill in live market. And, if your strategy gets you in when price is moving quickly, you might even get 2-3 ticks of slippage, depending on which contract.

To stay out of chop, I use the ADX indicator. But it's relative - unfortunately, it'll still get me in on signals as a trending market is transitioning into chop, and it will keep me out on signals when chop is transitioning to trend.


dstrader View Post
Strategy Analyzer (SA) is almost useless with custom bars (and in general to be honest). I use SA is a very limited fashion, maybe to find which moving average value may work best in a strategy set up for example. But I never trust the data fully until I go to the next step below.

Make sure you download historical data for a month or two and run the strategy with Market Replay. I bet your results will be quite worse unfortunately. The strategy may become unstable if you run for long periods of time, so you may want to break the backtest a week at a time, and load your results in a spreadsheet.

After you get a PF of 2.00 or more with Market Replay I would run the strategy against live data for a couple of months. If your PF is still above 2.00 you can consider starting a small account and see how the strategy performs in a live environment.

Good luck!

Yes I've just recently read about this weakness - unfortunate. But, will follow your recommendations here and let y'all know the results.

Thank you for all the thoughts and comments!

Follow me on Twitter Started this thread Reply With Quote




Last Updated on October 3, 2017


© 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