Search
× Search
Wednesday, February 5, 2025

Archived Discussions

Recent member discussions

The Algorithmic Traders' Association prides itself on providing a forum for the publication and dissemination of its members' white papers, research, reflections, works in progress, and other contributions. Please Note that archive searches and some of our members' publications are reserved for members only, so please log in or sign up to gain the most from our members' contributions.

Plan B

photo

 Alex Krishtop, trader, researcher, consultant in forex and futures

 Sunday, April 5, 2015

I have long witnessed a lot of discussions about trading platforms, or, rather, automated trading software (that is frequently misleadingly called "trading platform") and to my total astonishment even experienced people, or at least those that claim to be, never (sic!) discussed one small thing that sometimes can render all great profits you've made nil. I mean that to my memory there was no single discussion in this group about what you are supposed to do in case things are going wrong. We all know that it's important to always have a Plan B, right? So, I suggest to discuss it starting with a simple questionnaire: 1. Do you have a routine that suggests you when to monitor the state of your automated trading setup? 2. How do you check that actual orders and positions correspond to those suggested by your strategies? 3. What are you going to do in case you find discrepancy? 4. And, perhaps the most difficult one — have you ever calculated the expenses of your failure to check all this in a timely manner? Have you ever assessed the risks associated with these expenses and their impact on your performance? I strongly believe that without having clear answers to these questions one cannot pretend to be an automated trader.


Print

28 comments on article "Plan B"

photo

 Guy R. Fleury, Independent Computer Software Professional

 Monday, April 6, 2015



@Alex, this is kind of a silly question. Why would one have a plan B in the first place? You are supposed to have done your homework; this means you have designed your best trading strategy: plan A. It was chosen out of the multitudes you have tested as your best effort, or maybe simply the one you liked best. If you have so little confidence in your plan A that you need a plan B, then your plan A might not be worth that much. And if your plan A fails, then for sure it was not worth much.

This is like choosing the best trading strategy you have among many. I express this as: Σ(H(A).*ΔP) >> Σ(H(B).*ΔP) >, …, Σ(H(n?).*ΔP). Meaning that strategy A was much better than strategy B which in turn was better than all the other strategies. You could opt to play a combination of strategies A & B, but then, the outcome should be less than playing strategy A alone.

And if strategy A needed to consider as a big thing things like slippage, commissions or technical errors, then maybe strategy A was not that good in the first place and should not have been considered as plan A. Technically, if your plan A fails, it is because you lost, probably lost big thereby endangering your portfolio to the brink of oblivion.

Then plan B really becomes: do I quit the game or not?

If not, I need a new stake having lost the previous one on plan A. And I need a new plan, a totally new trading strategy, not a plan B. But if this new trading strategy is strategy B, I'm off to do even worst than the previous plan: plan A. In effect, I'm doomed! I'm the only one responsible for it by not accepting that strategy B would do even worst than strategy A, this knowingly and by design.

You put up front some considerations that should have only a trivial impact on your plan A and blow them up out of proportion, but they still remain trivial and should have little impact in your overall strategy design. If they every reached the nontrivial status then I would be the first to say: you have a bunch of lousy trading strategies: A, B, …, n?.

However, I would agree that one should not attempt automated trading if the best they can do is a lousy plan A. Why automate losing, why indeed!


photo

 Alex Krishtop, trader, researcher, consultant in forex and futures

 Monday, April 6, 2015



Guy, have you personally recovered a trading server with over 40 strategies running on 6 accounts after a hardware failure? Have you read what I asked in my original post? I do not want to discuss any properties of any trading strategy. I mean only risk management, and looking at your reply I understand that most likely I hit the point with my questions.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Wednesday, April 8, 2015



@Alex, you say: Not at all. In the last 15 years, one of my machines went down for something like 15-20 minutes. I simply switched momentarily to another machine. Consequences: nil. Could it happen again? Yes. But it could only have some impact if some action would have been required during that downtime.

From my point of view, and in my humble opinion, you look at minor problems as if they were of consequence, but all I see in the stuff you mentioned are part of the cost of doing business and that cost should be minimal compared to the outcome of running a trading strategy over the long term. Precautions can be easily taken to limit whatever limited damage might and will happen.

Whenever I read on some particular trading strategy where commissions, slippage or downtime matters I instantly lose what ever interest I might have had in it. It's understandable: I see the strategy itself as not worth much.

Nowadays, commissions are as low as $0.01 a share. That should not matter much in an overall strategy design! If it does, then the expected profit from such trades would probably be close to it. The only way to profit from such a situation would be with VHFT (very high frequency trading) where a large large number of trades, a huge capital base, and a big co-located IT infrastructure with ultra-fast data feeds would be required to make a difference. Like Virtu for instance. From what I see in this forum: none of that here.

We play a CAGR game, it takes years of compounding for a trading strategy to show its worth. Commissions represent less than 1% of trades. If this has an impact on overall strategy design, then it would imply that the CAGR is not far away from it rendering the strategy probably not even able to outperform an index fund.

Any trading strategy can be expressed as: A(t) = A(0) + Σ(H(?).*ΔP). Having for its CAGR: CAGR = ( { A(0) + Σ(H(?).*ΔP) - costs} / A(0) ) ^ (1/n) - 1. This puts all the emphasis on the trading strategy H(?) used as well as on how long it will be applied (n in years). And therefore, it's the trading strategy that should matter most and be designed in such a way that commissions don't really matter that much. Still, one should aim at paying as little commissions as possible but this without hindering in any way on the trading methodology used; meaning that commissions are not the driving force here, the trading strategy is. And if a trading strategy can not overcome commission cost by a wide margin, then one should go back to the drawing board and design something better.

Also, to answer your other point: I have not encountered a server shutdown running 40 strategies on 6 accounts. The reason is simple, I don't and wouldn't run 40 strategies live on a single machine without basic protection. Even if I am small, I've always had at least one redundant system in case one goes down momentarily. But I view this as part of basic precautions one should take trading live accounts.

From my side however, you, might not have understood the implication of the expression put on the table, so here it is again: Σ(H(A).*ΔP) >> Σ(H(B).*ΔP) >, …, Σ(H(n?).*ΔP). This says that at most you might need only a few trading strategies, each chosen as the best fit for each of the accounts. Why use strategy B if A is much much better?

If no trading strategy, out of the 40, really stands out, then maybe they should be classified as equivalent or less and ordered as in: Σ(H(A).*ΔP) ≈ Σ(H(B).*ΔP) >=, …, Σ(H(n40).*ΔP). With such a classification, running 40 strategies would appear to be sub-optimal. Note that running 40 strategies simultaneously also requires that each one be properly financed, or that one switches all the time from one strategy to the next which in itself creates a whole new set of problems.

In the end, it's the trading strategy that really matters.


photo

 Alex Krishtop, trader, researcher, consultant in forex and futures

 Wednesday, April 8, 2015



Guy, trading for yourself and for clients are two totally different things. Totally different. Especially large portfolios with large trading sizes. Not sure I need to comment the rest of your message, sorry.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Wednesday, April 8, 2015



@Alex, you say: <...trading for yourself and for clients are two totally different things. > Yes, but not that much. Both are bounded by the equations presented, and both play the same CAGR game.

The difference will come from position sizing, not returns. If I have someone able to trade in size a thousand times more than I, meaning that he has a thousand times more capital than I have, he is bound to make more money, but not necessarily a higher return on invested capital.

This can be expressed as: A(big)(t) = 1000*A(0) + 1000*Σ(H(?).*ΔP) which can be compared to: A(small)(t) = A(0) + Σ(H(?).*ΔP). In both cases, the CAGR will be the same:

CAGR(big) = ( { 1000*A(0) + 1000*Σ(H(?).*ΔP) - 1000*costs} / 1000*A(0) ) ^ (1/n) – 1 = r

CAGR(small) = ( { A(0) + Σ(H(?).*ΔP) - costs} / A(0) ) ^ (1/n) – 1 = r

Being small is not a sin. Everyone has to start somewhere. However, it does not change the nature of the problem. That one be big or small, they both are faced with the same inherent problem: producing the highest CAGR they can.

I have over 200 trading strategies to chose from. I've ordered them according to their respective potential performance levels; and of those, I'm only interested in the top 5 at most. All the rest is considered as also ran and less than the best I can do. In the end, there will be one trading strategy going forward: strategy A: Σ(H(A).*ΔP) >> Σ(H(B).*ΔP) >, …, Σ(H(n?).*ΔP). But it was necessary to design and test everyone of them to get to a final choice. And when I will design a new trading strategy, it will have to supersede all others including the top choice.

Again, it will be in the choice of trading strategy that will matter the most to differentiate strategies at the CAGR level over the long term. And there, commissions and downtime should be considered trivial on the overall design; otherwise there is not much to be said about strategy H(n?) or H(n40) for that matter.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Wednesday, April 8, 2015



To go even further in the understanding of the problem at hand and put it in the context of some of the available academic literature on portfolio management, one could consider the following expression more closely:

Σ(H(A).*ΔP) ≈ Σ(H(B).*ΔP) >=, …, Σ(H(n).*ΔP) → Σ(H(B&H).*ΔP) ← Σ(H(n?).*ΔP).

This one says that most trading strategies will tend to the average long term return as generated by a Buy & Hold strategy. And if one accepts this, which is what is mostly out there, then it won't matter much what particular trading strategy you might use over the long term. You too will be limited by this Buy & Hold long term CAGR performance level. You will find that your own trading strategy will have a hard time escaping the gravitational pull of the Buy & Hold: Σ(H(x?).*ΔP) → Σ(H(B&H).*ΔP).

If you want to exceed these limitations, you will have to design a better trading strategy such that Σ(H(A).*ΔP) >> Σ(H(B).*ΔP) > Σ(H(B&H).*ΔP). Meaning that strategy A is much much better than strategy B which in turn will be better than the Buy & Hold. And because your new strategy A will be better, you will end up applying strategy A as your best solution to the problem to the exclusion of everything else. Why go for less than the best you can do?


photo

 Scott Boulette, Algorithmic Trading

 Thursday, April 9, 2015



@Alex - I feel like I am reading two separate conversations; the one you posted and the one the other poster seems to be having with someone (not sure who).

As to your original question - Now that you mention it, I don't believe I have ever seen this topic brought up either and now I am wondering why; it is so critical.

I have back ups to back ups, network admins, data feed people, head of trading, head of IT, etc. all on speed dial. I have a direct connection to the CME order management portal and several times a day make sure I have valid credentials for the connection so if all else fails, I can cancel orders via the portal.

If connectivity is lost at any point in the chain, the algos automatically cancel all outstanding orders then shut down, the trade desk is notified and the positions are closed manually if need be.

I have every state of every order and every trade in a live database that is backed up nightly. If a cancel is rejected due to an on the fly execution, the trade is immediately scratched if possible and if not, it goes into a routine specifically written to handle that. If anything, and I mean anything happens that isn't expected, everyone who can do anything about the situation is notified immediately.

What I haven't done is really calculate the expense of not doing all this because I personally know of firms that have gone out of business because they didn't think this sort of thing was necessary.

As to what other posters have written...


photo

 Guy R. Fleury, Independent Computer Software Professional

 Friday, April 10, 2015



Some think that taking what should be considered part of basic precautions represent a plan B to be put to work when things go wrong. When in reality, these precautions are so basic they should be an integral part of their plan A.

If it's not the case, then their plan A has some real deficiencies and is designed to surely require a plan B.

@Alex had 4 questions. My answers, even though they have already been expressed:

Q1. An automated trading strategy needs to be monitored at all times. I don't know of anyone putting on an automated strategy live and then let it run unattended while he/she goes on vacation for a few weeks. The bigger the AUM, and the more an automated system will trade, the more it should be monitored. Everyone remembers Knight Capital's $450 million trading glitch in 2012. Just as everyone remembers the Flash Crash of May 2010. This last one did show a deficiency in many automated strategies' plan A that left live stop losses in the books. Only the trades that lost more than 60% were busted. All other executed orders on that day were upheld.

But then again, monitoring also depends on the trading style. If your basic intention is to buy and hold for years and years, monitoring does not have the same urgency.

Q2. An automated trading strategy is run by a computer software. It's up to the strategy designer to output to file or paper all the information needed to corroborate the broker's daily activity report.

Q3. Usually, there is a broker explanation for discrepancies. A lot of things can go wrong on the execution of a trade starting with power outage, software problems and computer glitches at the exchange, on their servers, on their distribution centers, the NBBO system, your internet provider, your computers, your software and maybe most importantly, your designed automated trading strategy (your plan A). Some think that because they have a debugged program, they should win the game. Well, they should think again. In my view, should you have a poorly designed program with inherent flaws; I would still hold you responsible for having let it roam free with your trading account in tow.

Q4. It is almost impossible to answer this question because it involves: it should have been or it could have been. What is the opportunity cost of not doing your work properly, of not solving the problems you knew were out there? A computerized trading program does what it is told to do, nothing more. If the trading principles you have incorporated in your strategy design will make it to fail with time, it's not the market that is responsible, it's you.

I see the real opportunity cost as not now, but as in 20 years from now for having delayed plan A's starting point: Cap*( (1+r)^21 – (1+r)^20). Try: Cap*( (1+r)^41 – (1+r)^40).

So, I would restate: if you need a plan B (a strategy B), it's because your plan A failed. And it can only fail if your strategy design was flawed from the start. It might appear as if the only real plan B is to quit after your plan A failed and eradicated your trading account.

An old member of this forum had for mantra: shit happens. From what I've seen, out of a few thousand trading strategies I've studied, often a lot of them have it built in.

If you need a strategy B, it would mean that your strategy A is not that strong or that it would do as good as A. Either you made the wrong choice or B is not needed. But to discover this, strategy A will have to fail and lose a lot of money. And because your best choice was A, then switching to B will do even worst. But then again, it's your money and you are entitled to do with it as you wish.

@Alex's original post was an invitation to present other perspectives, other points of view, well, you just had mine.


photo

 Marc Verleysen, founder at TSA-Europe -systematic trading

 Saturday, April 11, 2015



Not for the very first time, the discussion has two totally different types of "investors".

Running a buy and hold strategy (stock markets I would presume) can not at all be compared to trading strategies (e.g. currencies). The trading frequency is indeed completely different and as Guy rightly put for the buy and hold : there is less urgency since the time horizon is multi decade.

Alex's point of view is quite different and his questions are very valid. And indeed, there is a huge difference between trading your own capital and outside money. The latter puts much more pressure on the manager than the former. When a technical glitch causes losses in your personal portfolio, you can take it in your stride and look at a solution. An outside investor will react totally differently to such an event and might consider pulling his money.

A money manager can offer more strategies that are tailormade to investors' goals. So it does make sense to not only run the optimal strategy but have more on the shelve.

We have a multicurrency portfolio in which the "JPY-book" is the best performer. Now, does that mean that I should only trade the JPY-book ? Or do I opt for a more diversified portfolio that has perhaps better secondary metrics ? (remember, return is related to risk taken or leverage applied)

A client may very well come to us to have a solution to his Euro FX exposure, short term or longer term ... a multitude of strategies is concievable and justifiable.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Saturday, April 11, 2015



@Marc, yes, agree. There is not a one solution fits all. And this highlights the problem with a forum that wants to tackle all types of traders in all types of markets having huge differences in trading capital. It's as if each time one posts something, the context and restrictions should be given.

Personally, I don't believe in the one solution fits all markets and market conditions.

All one can do is use available capital resources the best he/she thinks is the best for his/her particular market based on their available knowledge of such markets. This leaves you with a whole gambit of possible trading strategies, each designed within their respective constraints and aimed at trying to produce the best performance one can going forward.

But still, of all the trading strategies one can design, the ones to go live should be part of strategies that have shown they have the potential to outperform within the group of strategies designed for that particular market. And again, the chosen strategies should at least beat the benchmarks otherwise the benchmark was the easier solution and readily available. This puts back the following expression on the table adapted to one's market:

Σ(H(A).*ΔP) ≈ Σ(H(B).*ΔP) >=, …, Σ(H(n).*ΔP) → Σ(H(Benchmark).*ΔP) ← Σ(H(n?).*ΔP).

And the question still becomes: can one really make an outstanding trading strategy such that in his/her particular market they can write: Σ(H(A).*ΔP) >> Σ(H(B).*ΔP) which says that strategy A is much much better than strategy B. This within its context would result in:

Σ(H(A).*ΔP) >> Σ(H(B).*ΔP) >=, …, Σ(H(n).*ΔP) → Σ(H(Benchmark).*ΔP) ← Σ(H(n?).*ΔP).

And based on such an expression, the game is no longer to have a plan B, but to design a still better and improved plan A; and thereby maybe the old plan A could become plan B. The more you design trading systems, the more your plan A will improve on its previous incarnations; new procedures will be found, better safeguards. Those strategies that will show less potential than the current implemented plan A will be discarded as a less than optimal solution. An easy decision, your plan A was already better.

The above expression also says that any strategy that is close to its benchmark might deserve only minimal attention since there could be a lot of solutions that could do better.


photo

 Scott Boulette, Algorithmic Trading

 Saturday, April 11, 2015



@Mark - As a trader, I have to have not only a plan B but C, D, etc. whereas an investor has the luxury of simply checking the stocks' prices the next day in the newspaper. If I understand Guy's suggestion correctly as advocating that plan B consist of designing a better plan A, that is at a minimum missing Alex's entire point.

As all professional traders know, if you trade algorithmically (remember what the group is focused on) and you don't have contingency plans for things like Alex mentioned, you won't be a trader for long because sooner or later it will happen.

As always let me be clear (some feathers are easily ruffled) - anyone is free to participate and their opinions are welcomed and appreciated but investors are not the focus of the group.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Saturday, April 11, 2015



It's easy to be misunderstood by some even if they know who you are and what you do. I deal in stocks, it's the only subject on which I've posted over the last 3.5 years in this forum. From time to time, I even put out the results of some of my backtests. The last one I put out was:


http://alphapowertrading.com/index.php/papers/174-devx-v6-revisited


Now, does that qualify me as an investor, a trader or both? Well, I would have to answer yes to all three (n'en déplaise à certains). In that last test, there were over 1 million trades executed over a 25 year period.


How many trades should it take to be classified as a trader?


Is there an investment side to my kind of trading strategy? Yes. It's an hybrid: it trades and uses generated profits to accumulate shares over the long term. A relatively easily understood proposition.


A group moderator goes so far as saying: <...opinions are welcomed and appreciated but investors are not the focus of the group. > As if saying that investors or long term players are not welcomed or should simply shut up. Wow, that's doting the i's and I do think that such a remark is aimed directly at one person.


I see the focus of the group as: “automated trading strategies” and I do think that even if you trade slowly, don't trade all the time, accumulate shares for the long term and trade over the process, it would still satisfy the requirements as long as it was “automated”. Which in this case, it is.


Should you have plans for when shit happens? YES. But, as I've said before, that should be part of your plan A. If it's not, then your plan A is somewhat deficient by not having some basic protections in place. You should be able to react and protect yourself because most often, after the fact, it is too late, the money is already lost. And if your plan B is to deal with what to do after you lost your money, I'm afraid the next strategy in line might not be the ideal solution. You weren't even able to design a protected and profitable plan A and that plan A was your chosen best choice. This surely does not baud well for strategy B.


photo

 Scott Boulette, Algorithmic Trading

 Saturday, April 11, 2015



@Guy - it is a semantics thing; Alex is correct that many traders do not have contingency plans for lost connections, etc and that is why he labeled it Plan B. You are quite correct, it should be a part of everyone's Plan A but then should is such an interesting word; unfortunately many traders do not have that type of thing in their Plan A.

If you trade in an automated fashion, I agree the speed does not matter. The point I was trying to make is that the post wasn't about - is strategy A better than strategy B or any formulas, it was "what you are supposed to do in case things are going wrong" (his words, not mine).

I made a bet with myself which wasn't really a fair wager; I absolutely knew that you (Guy) would find a way to take offense at me trying to keep the discussion on track with the intent of the original poster. Of course, I won. No one should shut up but neither should they hijack a thread.

As to your question about how many trades does it take to be classified as a trader - are you talking about live trades or backtest/simulated trades?

In my opinion, one live trade via an algorithm (I don't care if it is implemented in Excel) makes someone an automated trader but even millions in a backtest (or simulated) does not. Turn the strategy on live with real money and voilá, you are an automated trader.


photo

 Alex Krishtop, trader, researcher, consultant in forex and futures

 Saturday, April 11, 2015



Scott, your comments are to the point, as always though. I'm glad to see it as I already started to think that I wasn't able to explain myself correctly.

What I am seriously thinking now is whether it would be possible to find a way to quantitatively assess the aforesaid risks and therefore include them into a risk assessment model. For example instead of running dubious Monte-Carlo simulations tossing parts of history or equity curves, we could randomise the quantified external factors like what I mentioned and see how they could affect the overall performance. I am almost sure that any of those academic eggheads have already done such a research, but surprisingly I can't find any relevant information.


photo

 Scott Boulette, Algorithmic Trading

 Sunday, April 12, 2015



@Alex - I think quantifying this issue would be worthy of a PhD. dissertation but ultimately extremely difficult. Long prior to joining the firm I am now with, I was on the trading floor when a major prop shop had an algo meltdown (not one of mine). The algo inadvertently traded almost 300,000 "units" (NDA still keeps me giving out any possibly identifying information) WITH ITSELF in 3 seconds. To say chaos ensued does not remotely do justice to the next few minutes.

I mention this episode because even though the internal investigation quickly determined that a single developer decided to make his algo faster by taking out all the sanity checks (is the trading consistent with the normal trade pattern of this algo), nothing came of it ultimately except a small fine from some regulatory agency (of course, with no admission of wrong doing - "it was just an inadvertent bug") and the prime broker giving the firm the boot (other pb's were lined up outside the door to take their place).

The firm completely complied with all the regulatory agency's requests as to the situation. Yes it was a bug and of course, few (if any bugs) are put in on purpose but there can be no doubt that it was far from innocent.

The point is that even with all the authority of this agency, they never even got close to the root of the issue and had to settle for handing out what amounted to a slap on the wrist to the firm. No firm is going to admit to such an experience nor are they going to give any details that would make for a valid statistical survey of this type of thing.

Suffice it to say, it happens all the time, simply look at Knight Capital and how that particular debacle came about.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Monday, April 13, 2015



The original post centered around the question: can we monitor discrepancies between an order issued by an automated trading program and the actual execution of that order? And if so, can we estimate opportunity costs? In fact, a trivial question, but a question nonetheless.

An automated trading strategy is a program run on a computer to automatically generate and execute trades as dictated by its code. And to estimate opportunity costs, one would need to know first what type of orders are being used in what should be their best automated trading strategy ever (plan A = strategy A, with all its basic protections in place, otherwise it would be deficient).

By definition, a limit order is an implied contract with a trader that a trade will be executed at the limit price or better. On the buy side, this would mean that QP(program) >= QP(actual) and that QP(program) – QP(actual) → 0. In fact saying that most often, the programmed price will be exactly the same as the actual price: QP(program) = QP(actual). Otherwise, your program has a serious problem.

A limit order does not have a guaranteed execution; it will execute if, and only if, the limit price is reached and that you were the one at the top of the order queue in the live book. Technically, you will have the same limit price as if you had issued the order by hand by pressing enter.

This means that for limit orders, having discrepancies tending to zero, the overall impact is more than minimal. If it was away from zero, it would be at the buyer's advantage; and who would complain about a better average price than requested!

The other general type of order is the market order. This is an implied contract that you will get immediately the quantity of shares you wanted but with no guarantee on price execution. And this makes it a totally different kind of game. In this case: QP(program) <= QP(actual). In practice, the buy at market order will tend to move away from programmed estimates and will often cost more depending of the quantity of shares available on the ask and up to what depth the quantity requested can be met.

You are assured to have the quantity requested, but not assured as to its price. You will often pay a premium for the immediacy by having partial fills at higher and higher prices should the inside ask be insufficient to accommodate your market order. QP(program) – QP(actual) =< 0 and will tend to move away from zero at your disadvantage. This would tend to say: have your program look at what is available on the inside ask before issuing your buy at market order in order to minimize surprises.

One should live with the consequences of the trades they ask their programs to execute and their programs should know what type of orders they should take at any one time. The limit order case is without real consequences while the market order will tend to be a little more expensive than anticipated, and this by the very nature and type of order used.

Studies on price impact abound. Check Google Scholar for: "stock market" + "price impact". You should get over 10,000 hits. I've read more than a few of these and I would not qualify any of the authors as “eggheads” even if for only a few I had a diverging opinion. Most often, I would simply thank them for having done the research, compiled all the data and delivered it in a readable format. I am thankful to all these academics since I will not have to redo their research. Each one was bringing home a different perspective on the game I play. I take this occasion to extend my thanks to all of you who have done some of this research or has provided a link to such research, much appreciated.

In the end, it's still which trading strategy will you prefer: Σ(H(A).*ΔP) or Σ(H(B).*ΔP); or which do you expect to perform best: Σ(H(A).*ΔP) >? Σ(H(B).*ΔP)?


photo

 Scott Boulette, Algorithmic Trading

 Monday, April 13, 2015



@Guy - I think you are still missing Alex's main point. You appear to interpret his question as relating to expected execution price vs actual price, etc. or something along those lines.

As I read his question (and his comments just above seem to align with my interpretation), he is talking about all the things that can go wrong including software bugs. At the higher frequencies/shorter hold times (not specific to any class of instruments), those type of things happen more often and have a larger impact when they do.

I have had executions cross with cancels that were not handled correctly at several levels (code through trade monitoring) during live testing, luckily with very small size. Plan A was just like you describe but Plan B was (still is), I have a position I don't expect, exit it now, stop the algo, sort out from the logs what happened, fix the bug and then test again.

In trading stuff happens, it just does and if you don't have a very specific plan at the code level, at the trade desk level and at the personal level, if you trade live, you are going to run into issues that will make the above mentioned effort seem trivial.

On the other hand, I guess calculating CAGR on long term strategies has its appeal and may even help in some way I can't appreciate if I get a cancel reject because my order had already executed.


photo

 Alex Krishtop, trader, researcher, consultant in forex and futures

 Monday, April 13, 2015



Let me try to be more specific as I can see that not only Guy obviously discusses something totally different from what I suggested to discuss.

So.

1. Do you have a schedule according to which you monitor the health of your trading setup (server, connection, software, whatever)?

1. Do you have a signalling system to alarm you about any emergencies?

1. Do you have an exact plan what you do in case you find an erroneous position? Or lack of a proper position? Step by step, and on all levels, as clearly stated by Scott, not only general words like "hold positions or go to cash".

If you do I would be happy to discuss in a humble hope to learn something.

Please keep in mind that all my questions are strategy and market neutral, so please don't hijack the thread as Scott urged.


photo

 Scott Boulette, Algorithmic Trading

 Monday, April 13, 2015



@Alex - to clarify, I am urging the thread not be hijacked as I feel it is an extremely important issue that many new (and some not so new) algorithmic traders ignore to their peril.


photo

 Marc Verleysen, founder at TSA-Europe -systematic trading

 Monday, April 13, 2015



Hi Alex,

1. Servers, connections and software have been abundently tested for robustness before live trading commences.

We are FIXapi connected with heartbeats and the like. Automated restart procedures are in place in case of connectivity problem. The fixdatastream and the orderstream are connected one on one.

Should problems persist, automated procedure alerts people in charge.

1. In case a discrepancy in the positions is found : we trade multiple currency pairs in a "client" environment. Let me explain first to avoid follow up questions.

Our main server runs the models. The currency pairs, each in their own timeframes are treated as independent financial "entities" (for lack of a better word). The client environment is the elected portfolio of such "entities" that runs separately from the model calculation engine. Trade orders are generated on this higher client level. In case of a discrepancy between the "client module" in our system and the client account with the broker, we can intervene on the currency pair specific level (halting autotrading for that specific currency pair) or we can intervene on the client portfolio level, halting all autotrading. In these cases, we can fall back on manual trading based on the "client module" that will continue generating signals but no auto-execution is allowed.

Fortunately, we have not yet encoutered such major problems, but indeed, as I write this, it may be time to rethink all our procedures and see if they need updating (after all, technology has evolved since then).

Thanks for pushing us to do this exercise


photo

 Guy R. Fleury, Independent Computer Software Professional

 Tuesday, April 14, 2015



Someone using a single poor internet connection on some old technologies that crashes all the time using outdated software should not expect to win the now technological race to the fastest trade execution ever experienced on this planet. For those still of the flat earth society, I would suggest coming of age; and answer a few questions.

What is the probability of losing your data feed? If it's more than once a year and for more than a few minutes, I would suggest you change data provider. For instance, I use Interactive Brokers, they say they have a 99.9999% up time. This would translate over a year to about 0.1 minute of downtime or 6 seconds! What a disastrous situation. Maybe I should put on some protective gear, goggles or something. Obviously, some could have two data feeds to different machines; one serving as backup ready to pop into action on the push of a button or automatically.

Your computer crashed, ah, so bad. You will tolerate that how many times before updating to new and more reliable equipment? Don't you have a battery backup, generator, redundant system?

You want to play a game where money can be transferred automatically on a daily basis by software or by pressing enter on your keyboard and you would be squeamish at putting a few thousand more on the table to protect your assets. Does not sound prudent to me, maybe you definitely do need a plan B.

Your automated trading strategy goes insane which incidentally you programmed to behave that way, and you want to be excused? Undo those silly trades because you are losing money. Forget it! I really don't care if you lose your money, it's yours to do with as you wish. Putting a doomed program online is one way to do it.

However, when it's somebody else's money, I would require not only that you be well equipped to properly handle the task, but also that you have thoroughly tested your damn trading script before putting it live and lose other people's money. Knight's Capital did a stupid IT administrative move by putting an untested beta version of a program live without a big red shutdown button. Who should be responsible? They are. This should serve as a lesson to any automated strategy developer: if you don't do your job, then be ready to bare the possible consequences.

I have a very simple view: I don't put the needed equipment on the table to play the game at a proper level: it's my fault. I don't use the two best internet data providers: it's my fault. I don't properly test my trading programs: it's my fault. I have delusions as to what my programs can or can not do: it's my fault. I lose money because of any of the above: it's my fault. I won't go behind a plan B to find excuses for having lost my or anyone's money. I'll take responsibility for what I've done being the one that put his program live.

I would never dare put out a trading script live after developing it over a few hours over a weekend on a single security and back tested for only a few years. I design trading strategies made to last 20+ years. Naturally the first thing I should do is back test those same strategies over the past 20+ years. And if they can not survive those back tests to my satisfaction; they go directly to the dumpster. But back testing on a single security is not enough, it needs to be done at the portfolio level with 30 stocks or more in order to minimize curve fitting and over-optimization. When will I know my program reached its objective? In 20+ years, not tomorrow!

Volvo came up with this great idea for their crash tests: why don't we find a way to stop the car before it hits the wall at 50 m/h? They have, but they still use airbags, their plan B. Their new plan A is much better than their old one which is now plan B which by design is intended to not be used at all if at all possible.


photo

 Scott Boulette, Algorithmic Trading

 Tuesday, April 14, 2015



@Guy - you understand this, Alex understands it, I understand it but there are many who do not; that was the point of the original poster (Alex). He wanted to get them to think about how to eliminate as many variables in the situation as possible.

It sounds like you have this sorted out.


photo

 Marc Verleysen, founder at TSA-Europe -systematic trading

 Tuesday, April 14, 2015



Now I feel like the dumbest kid in the classroom.

I 'm out of here


photo

 Scott Boulette, Algorithmic Trading

 Tuesday, April 14, 2015



@Marc - I was quite happy to hear about your setup because it is very analogous to how I handle signals internally. I know a lot of traders and you are certainly not in the dumb camp.


photo

 Stefan Simik, Quant / Trading Systems Developer

 Wednesday, April 15, 2015



This is interesting topic for me,

because we are currently implementing this type of security into our algo-strategies.

Question: Do you have a routine that suggests you when to monitor the state of your automated trading setup?

Our idea for monitoring health of running algo-strategies is to use external server with separate internet connection.

On the side of algo: each strategy periodically (each 15 secs) reports its own status to this server.

On the side of server: server periodically (each 40 seconds) checks each strategy, if it reported status.

If the update about status status of the strategy was not found, right people are notified by EMAIL + SMS with specific text/keywords. Each responsible person has configured mobile phone to periodically scan for this type of notification EMAIL/SMS with specific loud ringtone for critical situations and resolve the situation manually.

Our experience says, that people are aware about the problem in 60 seconds most of the time..

Question: How do you check that actual orders and positions correspond to those suggested by your strategies?

We are not checking individual orders separately right now. We use statistical approach currently - Each strategy is aware of its own historical backtest results (ideal results)

and if current position / open drawdown hits the critical treshold value (like 75% of historical max drawdown), then this event is immediately reported.

Question: What are you going to do in case you find discrepancy?

Manual intervention. No automatic solution right now.

Question: And, perhaps the most difficult one — have you ever calculated the expenses of your failure to check all this in a timely manner? Have you ever assessed the risks associated with these expenses and their impact on your performance?

Truly not. It is hard to predict/evaluate this precisely.

We proactively calculate 10% of performance of the strategy for these type of events. So they are expected expenses.

We had many various issues: incorrect technical programming, misconfiguration (human factor), internet connection loss resulting in strategies got ouf of sync with market, ..

But this type of internal problems were significantly reduced in a short time.

Maybe with more years of experience and operational troubleshooting, we will have some good statistics, that allows us to evaluate the expenses more exactly.

All our strategies are monitored 24/7 and in control of 2 independent people, that check, if everything operates smoothly.


photo

 Alex Krishtop, trader, researcher, consultant in forex and futures

 Thursday, April 16, 2015



Thank you, Stefan, your answers made me think about revising my own procedures. I am very curious about your statistical approach to identifying discrepancies between actual positions and hypothetical — what is the typical holding time of your positions and how many could be there in the market at a time concurrently?


photo

 Stefan Simik, Predictive analytics / Trading Systems Developer

 Saturday, April 18, 2015



QUESTION: I am very curious about your statistical approach to identifying discrepancies between actual positions and hypothetical ...

The most common statistical values we check are:

* 75%, 90% of Daily / Weekly / Monthly maximal historical drawdown.

Anytime, strategy touches/crosses these values -> new event is generated and reported by email + SMS which notifies right people..

This super simple stats looks sufficient for us these times.

We check manualy, if the reported event is OK and if it is not OK, t

hen we immediately close the trade.

After that, we investigate problem and make improvements for the future.

(We found, it is more intelligent just to move the stoploss below last small

swing and give the trade a chance to go out for better price)

QUESTION: What is the typical holding time of your positions?

In our case - typical holding time of common trade is relatively low -

something around 15-20 min. We are trading on lower intraday timeframes 1-min up 15-min only. The reasons are, we feel much more comfortable to be (relatively) independent from economic changes, cycles or longer market sentiments.

It is common, that we take LONG in the morning when markets are going up and go SHORT afternoon, when US news caused different sentiment.

We are closing all our positions 15 minutes before end of trading session, to be not exposed during 1 hour pause during EU midnight and ... next day comes with new opportunites. That's the way, we can have a good sleep = we know, we are flat.

We take risk again in the morning, during the most liquid market hours,

where we found best predictability for our trading style.

QUESTION: How many could be there in the market at a time concurrently?

Typically 1-2 positions open concurrently and this can go up to 8 concurrent trades during extreme volatility, where many strategies want to act. This number is constantly increasing each 1-2 months, as we are constantly adding new strategies, or existing strategies applied and adapted to different markets.


photo

 Bharath Rao, Co-Founder, Head of Products

 Thursday, May 21, 2015



I guess people will start thinking of plan B when they start seeing significant drawdowns. I would also add that it's good to have a family of strategies whose performance may be highly correlated but drawdowns are less correlated.

Please login or register to post comments.

TRADING FUTURES AND OPTIONS INVOLVES SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS
Terms Of UsePrivacy StatementCopyright 2018 Algorithmic Traders Association