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

  #101 (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 I exited my short positions on the re-open of the market, but had to do it manually. I added the SetExitOnClose to my strategy, but it didn't do anything. I think it was my mistake, in that I added it after 1600 ET, so the strategy was not re-evaluated until after the bar was closed. I will try again tomorrow with a position and see how it works.

So I hit my goal of getting my sim balance back to $16k:


This is what the chart looked like:


One good move, that was all that happened and all I needed. Now I'm not too concerned with that balance, as I will be using the sim account for some other testing, such as the exit on close mentioned above.

Okay, to bed now, for reals (as the kids say).

~vmodus ... out

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?
Deepmoney LLM
Elite Quantitative GenAI/LLM
Futures True Range Report
The Elite Circle
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
 
  #102 (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


ocpb View Post
Hi vmodus, I probably can't help all that much, but just wondering...
Since you're testing things...
Did you enter your live limit order test by clicking on a DOM at the 98.1025 price?
How about the same for a later contract month? All good?
Maybe the platform somehow thinks that EDZ19 is not the front month anymore.
Does TS have any other interfaces you can enter an order in, say a web or mobile?

Also, what about the tradestation discussion forum? I searched on there and there are at least one result about rejected orders. I can't read that forum since I'm not a TS customer, but maybe there are people on there that would have more insight.

Sorry, I totally missed your response last week. Yeah, I tried pretty much everything (Trade Bar, Chart Trading), no luck. The forums did not help, but @kevinkdog helped me by posting a request on the forum.

The price on the front month char shows .0025 increments, and later months at .005. It is not a data or chart issue. I'm guessing a bug.

Anyhow, thanks for the suggestion!

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #103 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,647 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338



vmodus View Post
So yesterday was a little boring for December 19 Eurodollar, which got me thinking last night that maybe I should switch to the March 2020 contract. So I set my strategy in sim on the EDH20 before I went to bed.

When I had a little more time to look at it this morning, I found that if I had this strategy on this contract, I would have had a couple of minor, but profitable trades (~$250 worth). Anyhow, my strategy did pickup a short trade (currently +$375). Hopefully it holds and I can eek $250 profit, which puts my sim account balance back to $16k, my little goal.

EOD Exits in Easylanguage
So I have a parameter in my strategy that I can set to exit at the end of the day. I coded the exit, but it did not work properly.... or rather, didn't work at all. So I stumbled across SetExitOnClose, which is a function that will exit whatever positions I have open for this instrument at the end of the day. So I created a new version of the strategy and replaced my faulty exit with SetExitOnClose.

At first blush (backtesting), it appears to work better than my current exit. I am now running it through the gauntlet of testing to see what it will produce. The next true proof for this function is in sim.

To be continued....

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

I think that is all I have for today.

For tomorrow:
  • Finish reading Building Winning Algorithmic Trading Systems
  • Keep running my Eurodollar strategy in sim
  • Test the SetExitOnClose in my sim account



~vmodus

Don't waste your time testing setexitonclose. It works just fine in backtest, but will NEVER work in real trading (unless you are using custom sessions).

The reason?

Your chart gets notified when a session ends, and that is the last tick of the day. When that happens, setexitonclose says "oh it is the end of the day, I should sent my order to close."

Of course, it dutifully sends its order, but guess what? It is rejected because the market is closed!

Pretty silly, right? But that is what happens.

Your best bet is to use a time based exit (if you are using minute bars), or a custom session that ends a few minutes before the exchange closes (again for minute bars. With a custom session, set exit on close will actually work).

Follow me on Twitter Reply With Quote
  #104 (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


kevinkdog View Post
Don't waste your time testing setexitonclose. It works just fine in backtest, but will NEVER work in real trading (unless you are using custom sessions).

The reason?

Your chart gets notified when a session ends, and that is the last tick of the day. When that happens, setexitonclose says "oh it is the end of the day, I should sent my order to close."

Of course, it dutifully sends its order, but guess what? It is rejected because the market is closed!

Pretty silly, right? But that is what happens.

Your best bet is to use a time based exit (if you are using minute bars), or a custom session that ends a few minutes before the exchange closes (again for minute bars. With a custom session, set exit on close will actually work).

Thanks, I wont. What you described is kind of what I thought, but surely TS wouldn't give us a function that serves no real purpose would they?


I guess it is like an appendix.... it's there, but serves no useful purpose. I'll go back to my time-based exits.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #105 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,647 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338


vmodus View Post
Thanks, I wont. What you described is kind of what I thought, but surely TS wouldn't give us a function that serves no real purpose would they?


I guess it is like an appendix.... it's there, but serves no useful purpose. I'll go back to my time-based exits.

~vmodus


It goes back to the days when Tradestation first started, and backtesting (not automated live trading) was all there was. At that time "setexitonclose" was great for backtesting.

Now, it is only good with custom sessions.

I have found, however, that it is a great litmus test for trading "educators." I have seen quite a few show daily charts that use setexitonclose, and of course their results look great. Them doing that is a dead giveaway - they don't trade it live!

Follow me on Twitter Reply With Quote
Thanked by:
  #106 (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 didn't post anything yesterday for a few reasons. I am fighting a cold (I'm winning), so I'm really just tired ("don't trade tired or sick".....Kleinman) and not terribly productive. The other reason is that my strategy, as of right now, has not produced any new trades (Eurodollar March 2020 contract, 60 minute).

I did have one signal for a short position, but the limit price was never hit, so no entry. I'm glad both sim and my strategy report are in agreement. Here is what the last two days look like:


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

Other than that, it has been a good day. Sometimes my wife/trading partner and I will go for a walk to discuss where we are with trading strategy development, markets, etc. We get some physical activity and get some work done at the same time. The big topic today was the book, Building Winning Algorithmic Trading Systems. She finished reading it Tuesday and found it to be a wake-up call, I believe. We both realize that we need to formalize our strategy development process, and the book provides a pretty good process for strategy building, testing and deployment (or binning if a strategy does not pass all tests).

I have been thinking about the processes in the book. The process is similar to SDLC (software development life cycle), so it is a familiar and comfortable process for me. Isn't algorithmic strategy development essentially software development at it's core? I want to expand on Davey's process and create a full blown process diagram. I probably won't be able to get to that until January at the earliest, due to current time constraints.

Along with that thought, one of my goals for our little trading organization is to formalize a lot of our processes, in particular cataloging strategies, entries, exits, functions, etc. We have been winging it for a long time and it is really not sustainable. This is the horrible part of system trading development that not many developer's enjoy doing, but is very important. We have all sorts of strategies, ideas, custom functions, and random code floating all over the place. It is a hot mess. The main point here is our need for discipline. To quote Aristotle, "Through discipline comes freedom", or as Jocko Willink paraphrases, "Discipline = Freedom".

I could write a book chapter on this subject, so I will just stop myself here.

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

The rest of today and tomorrow:
  • Finish Building Winning Algorithmic Trading Systems
  • Work on some code problems for my partner

That is all for today! Gotta hit the books.

~vmodus

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


kevinkdog View Post
It goes back to the days when Tradestation first started, and backtesting (not automated live trading) was all there was. At that time "setexitonclose" was great for backtesting.

Now, it is only good with custom sessions.

I have found, however, that it is a great litmus test for trading "educators." I have seen quite a few show daily charts that use setexitonclose, and of course their results look great. Them doing that is a dead giveaway - they don't trade it live!

This is kind of funny, but not in a good way. The Dictionary makes it seem like you can still use it, but if you look at the related built-in strategy, Close at End of Day this what they state:

Quoting 
This exit strategy is designed for use only with back-testing; it is not recommended for automation.

Funny, because the only thing in this strategy is SetExitOnClose. I'm not sure which is more accurate, the strategy or the Dictionary.

I guess someone thought it was a good idea at some point, but even for backtesting I can see it giving wildly weird backtesting results.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #108 (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 figured I should share this, since I've been writing about EOD exits. This is a simplified version of my solution (my solution is a little more elegant and efficient). It works on the 60 minute chart and Eurodollar, for now, but as someone pointed out to me it will not work on different timeframes/market close combinations (e.g. ES 10 minute chart with a 1615 market close). I'll have to puzzle that through when I need it for those markets.

Here is the logic in pseudocode:
If the current time = start of last bar
and I'm in a position
and the EOD exit flag is set to 'yes'
then buy-to-cover or sell all contracts
If you code in Tradestation, maybe you will find this useful:
 
Code
// Exit at end of session
If time = CalcTime(Sess1endtime, -Barinterval) 
   and MarketPosition = 1 
   and eod_exit = 1
      Then 
         sell ("Long Exit EOD") Currentcontracts contracts this bar at close ;
            
If time = CalcTime(Sess1endtime, -Barinterval) 
   and MarketPosition = -1 
   And eod_exit = 1
      then 
         buytocover ("Short Exit EOD") Currentcontracts contracts this bar at close ;
I think this might work in Multicharts, though you will want to check the functions to be sure. I hope you find this useful.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #109 (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 just finished reading Building Winning Algorithmic Trading Systems. Rather than bore you with the details, I just put it over in the Highly Recommended Books thread:


Let's just say I recommend it and there is a little something in there for discretionary traders, too. I would say that this is a must have for algo traders. Just sayin'.

Now I have to work on a task for my partner, coding something or another.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #110 (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, this week has been wildly boring for my strategy. It has been very quiet, with no trades over the past 3 days. I won't bore you with the chart.

Right now I am working through a lot of backlog and am in the process of upgrading some systems (NAS, etc.), so I have not had a lot of time to dedicate to trading today. I am sorting through some of the content for my upcoming Strategy Factory course in late January. I am really excited about it.

It is wine o'clock, so I'm going to empty the dishwasher and be domestic. I hope you all had a great week and I'll see you on the other side (of the weekend, that is).


~vmodus

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




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