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 91,873 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

  #121 (permalink)
userque
Chicago IL
 
Posts: 180 since Apr 2016
Thanks Given: 573
Thanks Received: 129


SMCJB View Post
On a daily bar the close is the official settlement price which is different than the last trade. For example with Crude / CL the settlement window where the settlement price is determined is from 1:28pm to 1:30pm Central but the last trade occurs at 4pm when Globex shuts. That 2.5 hour difference can result in some significant differences in close/settlement and last trade. A way round this is to use 1440 min bars. These are effectively daily bars but with the actual last trade of the day rather than the settlement price.

Thanks, I understand now. I guess I assumed a trading platform's [scripting] language would handle this sort of thing.

I use C# to load and pre-process historical raw minute data [from a csv text file]; how do you handle holidays? Do you extend the last [good] data [bar] to fill out the rest of the 1440 bars, or do you use zero to fill them out, or something else?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Are there any eval firms that allow you to sink to your …
Traders Hideout
NexusFi Journal Challenge - April 2024
Feedback and Announcements
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #122 (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
On a daily bar the close is the official settlement price which is different than the last trade. For example with Crude / CL the settlement window where the settlement price is determined is from 1:28pm to 1:30pm Central but the last trade occurs at 4pm when Globex shuts. That 2.5 hour difference can result in some significant differences in close/settlement and last trade. A way round this is to use 1440 min bars. These are effectively daily bars but with the actual last trade of the day rather than the settlement price.

Wow, thanks for the explanation and the alternate solution @SMCJB! This makes total sense to me.

~vmodus

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



userque View Post
Thanks, I understand now. I guess I assumed a trading platform's language would handle this sort of thing.

I use C# to load and pre-process historical raw minute data; how do you handle holidays? Do you extend the last data to fill out the rest of the 1440 bars, or do you use zero to fill them out, or something else?

Since we do not, as a rule, trade right before or on a US holiday, it is a non-factor.

I have written a function to stop trading around holidays. The function is mostly used for backtesting, as we manually disable our strategies before holidays.

To get the data for a market close of 1pm (1300 ET) before a holiday, for example, I would probably write a function to store the last bar's value based on date/time, similar to my solution described earlier. Use an array to store the dates and times of irregular market close, and use the function to get the values from the array. It mucks up the code, but if I need to have it fully automated, I suppose I would have to write something to code around it.

I hope all that makes sense.

~vmodus

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

Today has been a wild ride. Let get to it.

Eurodollar Strategy
So things are humming along, with no trades. I look at the chart and see a couple of crossovers with no trades. What?!? So I look at my setup and noticed that I hadn't changed my dates from last week... i.e. my strategy was essentially off.
This is what the parameter setup looks like:

{FYI: TradeStation stores it's dates as an integer and in an odd format: 1200110 = Jan 10, 2020 (120 = 2020 , 01 = Jan, 10 = the 10th).}

I missed a losing trade (-$155 net loss) and should have been in a short position when I noticed this. I manually entered the second missed trade just to try and align to the strategy. I ended up exiting that position as the limit price from the strategy wasn't hit anyhow and the market had stalled... anyhow, it was a hot mess.

Strategy versus Sim
  • Strategy Report: Net Loss = -$310
  • Sim Trading: Net Loss = -$30 (commissions on 10 contracts)
  • Win rate = 0% (2 trade)

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

VX Strategy
This was another hot mess. The strategy got off to a bad start, in that a phantom order was placed by the strategy, but it did not appear on the strategy performance report. I suspect this is a technology issue. We have noticed that we get this once in a while if we do not restart TradeStation or our PC. Anyhow, the phantom order happened this morning, to the tune of -$155 net loss.

The first bad trade was offset by later trades. Then we had a combination of things happen. We had a buy signal, which was filled, then a reversal (sell and sell short) the next bar. The actual trend changed just enough to trigger these signals, but the short signal was in the wrong direction of the next trend. So we are in a short position when the market takes off long.

A stop loss was set to kick in, but it was rejected by the simulator. I had to manually set a limit order and a disadvantageous price because the market was running. I exited with a loss of -$402 (stop loss is $200, btw).

So the stop loss thing wasn't bad, because it showed an error in the code. I need to modify my strategy to send a limit order for a stop, rather than using the built-in SetStopLoss function.



After all that nonsense, things got back on track. One short-side crossover was missed because the limit order price wasn't met (as expected). It then reversed to the long side. The EOD exit was a little awkward and I had to manually intervene. I think I may set the EOD exit to occur a few bars before close. Limit orders are tricky here.

Strategy versus Sim
  • Strategy Report: Net Profit = $280
  • Sim Trading: Net Profit = $100
  • Win rate = 71% (12 trades)

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

Two Systems at Once
Today is the first time I have had two orders in two different systems at the same time. This is one of our goals, which is to have multiple tradable systems running concurrently. Overall, in spite of the problems, it went well. Overall, the systems generated $70 net profit. Without the snafus, it probably would have caused other issues.

Total results for two systems:
  • Total sim net profit: $70
  • Total strategy performance report net profit: -$30
  • Win rate: 69%


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

Lessons Learned:
  • Allow a strategy to run in sim until confident it is following the rules perfectly; we were tempted to start early, but resisted
  • Get out of a bad trade quickly; it is an age-old lesson, but we applied it
  • Check my trading parameters when setting up automation

Tomorrow
  • Write a stop loss exit in my VX strategy
  • Keep running both systems in sim
  • Replace the evaporator fan in my refrigerator
~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~

Have a great evening and I'll see you tomorrow!

~vmodus

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

Today was quite interesting.

Not trading related, but I have had quite the day. I checked my strategies then got a haircut. I fixed my refrigerator, all by myself. I had to overnight a part, but it came today and I fixed it in less than 10 minutes. It still ate into my work day, but when you are just watching automated strategies run (like watching paint dry), it is not like it terribly impacted my day.



Okay, back on topic. On the trading side of things, my strategies ran. Let's go one by one, then in aggregate.

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

Eurodollar Strategy
This was flat. It took some trades, but it was locked in a range, so all I lost was commission. Unlike some strategies and instruments, this doesn't whipsaw your account to shreds.

Strategy versus Sim
  • Strategy Report: Net Loss = -$90
  • Sim Trading: Net Loss = -$75 (all commissions)
  • Win rate = 0% (6 trades/3 round trips)
The difference in commissions is as stated before: I pad the strategy report a little more.

ATR is still impossibly low. As mentioned last week, we may not trade when ATR is really low as it is. Here is a sample of my 60 minute chart with ATR at the bottom:


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

VX Strategy
This strategy is supporting my Eurodollar habit.

Seriously, the VX strategy did okay today. There were a bunch of signals that did not result in trades, which is an expected outcome with my limit orders. There is no reason to enter a bad trade, which the limit orders help prevent. I did not have time to fix the stop loss issue, which means I also did not have time to fix the end of day issue. I placed a manual limit order to exit my position. I think I will have my strategy look at 16:10 ET for my exit, because there is plenty of volume as everyone else is unloading their contracts before 16:15 ET.

Strategy versus Sim
  • Strategy Report: Net Profit = $220
  • Sim Trading: Net Profit = $189
  • Win rate = 67% (12 trades/6 round trips)

The difference in net profit is that the report is looking at the price at end of day, so it is $50 higher than my actual exit. This should be fixed by tomorrow, I hope.

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

Overall Results - 2 Strategies

Strategy versus Sim
  • Strategy Report: Net Profit = $130
  • Sim Trading: Net Profit = $114
  • Win rate = 67% (12 trades/6 round trips)

I am still waiting for Eurodollar to bust out of its funk, but it will happen eventually. The strategy report is closely matching sim results. I am happy with where we are with this. The one thing that is interesting to watch is what happens with open profit/loss. With two positions, it can be all over the place, up-down-sideways (and is essentially a useless metric). If I ever get motivated, maybe I will make a small timelapse recording of it and post it here.



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

Exploring New Charts

I spent some time today just thinking about charts and data, and how I can mimic the VX and Eurodollar charts in how it looks. I am toying with range charts in TradeStation, with different price ranges and time intervals. They look funny, but maybe I can use them. Here is YM (Dow e-Mini) 15 minute chart:



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

Tomorrow
  • Run my strategies in sim
  • Fix my stop loss and EOD issue on the VX strategy
  • Further explore my new charts

Have a great evening everyone!


~vmodus

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

Today was wacky Thursday, mainly because I made it so.

I applied one of my strategies to the funny zig-zaggy chart I showed yesterday and decided to just let the strategy run overnight in sim (Euro FX, ECH20) to see what would happen. The backtest results looked great, so why not? Guess what? It blew up. ( Don't Let the Pigeon Drive the Bus).

So if you see my closed P/L screenshot later in this post with a large negative number, you will know why.

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

Enough of that silliness. I continued trading my Eurodollar and VX strategy in sim.

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

Eurodollar Strategy
ED continued flat. It basically looks the same as it did yesterday. Rather than bore you with the details, you can always just look at yesterday's journal entry.

Strategy versus Sim
  • Strategy Report: Net Profit = $65
  • Sim Trading: Net Profit = $65
  • Win rate = % (4 trades/2 round trips)
I forced the final exit when I reached my last trading bar of the day, by manually placing my exit order to pick up the $125 profit for 10 contracts. Unattended, I would have let this go, but in real life I would have taken the money rather than give it back to the market. This is my first profitable day with Eurodollar this week.

One item of note: the ATR, still riding below the minimum point movement, gives me a discretionary trading idea for this instrument. If ATR is below the minimum price movement, then trade the top and bottom of the range. I mean the open and close of each bar for the last 24 hours have been the same prices, as shown here:


I will have to give it some more thought, but it has some potential for bringing in a little more 'folding money' when this instrument is sleepy.

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

VX Strategy
This strategy just keeps chugging along, 4 days in a row profitable. This is not unexpected.

Strategy versus Sim
  • Strategy Report: Net Profit = $615
  • Sim Trading: Net Profit = $639 (estimated, since I was testing the other strategy)
  • Win rate = 67% (34 trades/17 round trips)
No real difference. There were no missed trades. The strategy report (what should have been) matches the sim results (what was) for the most part, aside from some rounding of the commissions. I am very happy about that.

It was an unusually heavy trading day for us.

Here is my equity curve for this week, on the VX:


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

Overall Results - 2 Strategies

Strategy versus Sim
  • Strategy Report: Net Profit = $680
  • Sim Trading: Net Profit = $714
  • Win rate = 67% (38 trades/19 round trips)
Note: Automated trading is kind of boring.

As mentioned earlier, my P/L for the day and the balance are a little goofy:


I will update my sim account to reflect the correct balance for the end of today.

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

Other stuff:
I fixed my stop loss and EOD exit for the VX strategy. This solution is essentially just sending a limit order when my stop loss amount is hit. I tested it successfully, so I updated the code I was using in sim, to verify that it works at end of day.

All-in-all a good day of work and trading. The wacky stuff at the beginning with the Euro FX chart was just to see what would happen.

Tomorrow is Friday....see you then!

~vmodus

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

It is a quiet morning in my office, so I thought I would spend a little time on just some trading things rather than just results.

Psychology
I haven't talked much about this mainly because my emotions are in check by the fact that automated systems take a lot of the emotion away. By way of analogy, it is hard to get too mad because your box of cereal is not full when you buy it (no you weren't cheated) or too happy because a baker's dozen is more than a dozen. It is what it is. You can be mad that a strategy is not performing, but 2+2 still equals 4. If it is executing as designed, meaning no bugs, then you have to accept it.

The other day I experienced some highs and lows, but I used mindfulness to manage it. I stumbled across something that I thought was going to crush the market, so of course I ran with it, with that wonderful rush of hopefulness we experience when we see something that is just out of this world. By experience, I know that in trading, if something is too good to be true, it probably is. Such was the case here. So then, I had to temper my disappointment when my idea failed terribly (see yesterday's journal entry, 'Wacky Thursday'). But coming down was easier because I didn't let myself fly high on the idea.

What I'm saying about my psychology is that I try to temper whatever is happening. Automated trading, or as I prefer to refer to it, algorithmic trading, helps a lot.

My need to be right
Like most humans, I have a very strong need to be right. While watching something go bad this week, I had to stop myself several times from disrupting the flow of automation and system development, and let it play out as it should. I have, from time to time, thrown an internal temper tantrum, when I am wrong. I rarely externalize things.

I have heard parents at soccer matches tell their kids, when they got or are getting crushed by another team: Trust the process. In the context of soccer, their team has a process for developing soccer players, not just winning games/tournaments. I have to tell myself to trust the process of developing ideas into trading systems. When I go off script, bad things happen and things get destroyed. It happened with me and the VX last year. It is part psychology, part discipline. So here are two quote that I need to abide by:
  • Trust the process
  • Through discipline comes freedom
Beliefs written into an automated system
Van Tharp rightly states in his writings that we trade our beliefs. Building and trading an automated system is not immune to this. Indeed, when we develop and write our systems, we are literally codifying our beliefs. Of course, what we believe may be totally wrong.

What else?
I have been contemplating this thought: once I have a set of strategies that are working and running, then what? I am a bit of a futurist and always looking at what might be ahead. What happens if I get to a point where I am just running and monitoring strategies? These are somewhat existential questions I am spinning in my head, probably no doubt along the lines of Maslow's hierarchy of needs, but adapted to trading. Once I get past just surviving with my account intact and eventually thriving....what is next?

I know strategies eventually die, so the exploration and development process should never end. I could do discretionary trading on the side. Start a podcast. Start a band (not really). I'm not sure what life looks like when I'm just running strategies. Like, this morning, my trading activities are this: nothing. Yes, I know 'automated trading is not unattended trading', but in sim, there is not much to do. I am going grocery shopping now, then will come home and make some pćo de queijo for multicultural night at my daughter's school.

I will have to refer back to Tim Ferriss' The Four Hour Workweek, where he addresses this type of existential problem.

Other journals
I follow a few other journals, and I must say that I admire those of you who are discretionary chart traders. I am mostly lost when I try to follow along. Anyhow, hats off to those of you who can do it successfully. So thanks to @snax, @Zachary Standley, and others for laying it out there with regularity. I don't always understand what I'm reading, but I always glean something useful. You also inspire me to be diligent in my journaling.

~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~ + ~
Now I'm off until later. My VX strategy just kicked in at 900 ET, and my ED strategy picked up an order earlier this morning.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #128 (permalink)
 
Maelstrom's Avatar
 Maelstrom 
Austin, Texas
 
Experience: Intermediate
Platform: Ninjatrader
Broker: NinjaTrader
Trading: RTY, ES, YM
Posts: 172 since Jul 2011
Thanks Given: 694
Thanks Received: 406

@vmodus .... Portuguese?

Absorb what is useful, discard what is useless and add what is specifically your own. – Bruce Lee
Reply With Quote
Thanked by:
  #129 (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

Almost... a few times removed. My wife is Brazilian, I am an American mutt. Our family was in Portugal for a couple months last year and loved it. Pćo de queijo is a distinctly Brazilian food, developed when Portuguese colonists found they couldn't grow wheat, so used cassava root starch (tapioca) for flour.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #130 (permalink)
 
Maelstrom's Avatar
 Maelstrom 
Austin, Texas
 
Experience: Intermediate
Platform: Ninjatrader
Broker: NinjaTrader
Trading: RTY, ES, YM
Posts: 172 since Jul 2011
Thanks Given: 694
Thanks Received: 406



vmodus View Post
Almost... a few times removed. My wife is Brazilian, I am an American mutt. Our family was in Portugal for a couple months last year and loved it. Pćo de queijo is a distinctly Brazilian food, developed when Portuguese colonists found they couldn't grow wheat, so used cassava root starch (tapioca) for flour.

~vmodus

Half mutt here myself, but my mom and grandmother are from the Azores. Had a chance to spend a couple of summers there when I was a kid, and it may very well be the retirement spot for us someday.

Recognized the portuguese, but not the bread itself, so makes sense that it is Brazilian. Looks good though! We may be missing out on the good stuff across the pond there.

Have a great weekend

Absorb what is useful, discard what is useless and add what is specifically your own. – Bruce Lee
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