Help Center Blog Open An Account

Automated Trading Strategy for Emini S&P


While I have been trading the eMini S&P for some time now, this is the first time I am looking to automate a strategy. Strategy hopes to capitalize on volatility. Idea is to go long and short a contract at the same time (in different accounts) with a stop loss based on certain calculations and setting a percentage trailing stop using certain other calculations. I expect the strategy to take a trade at least once a day (long and short). Looking to see whether anyone has attempted a similar strategy, which platform works best, any other suggestions or criticisms are welcome.


Some of the community members will come and give you some guidance as far as automation and feedback. However, the more experienced traders we have, use Multicharts Powerlnguage. In the past when we ran it, it was verts stable, and you could run fast data feeds on it.

As far as going long and short, yes, it must be done in separate accounts because “hedging” is not allowed with USA regulators. On a personal note, the long and short strategies simultaneously, are not ones I am supportive of. Essentially, you manage two positions with the assumption that one will get stopped out while the other continues to make gains to cover the losses from the other? In my opinion, automated strategies shade simple and one dimensional, with “exotic” variations.
I hope I am not discouraging you, rather trying to protect your hard earned money.

Others will weigh in soon.

Thank you,
Matt Z
Optimus Futures


A couple of points worth mentioning…

  1. You could do this with being long in one account, and short in another account, but I believe that is illegal in the US. Essentially you are creating wash trades, and artificially increasing volume by trading with your self. You may have to explain your approach to a compliance officer eventually. Speaking from experience, that is not fun (and what I was doing was legal, it just looking funny to compliance).

  2. One reason this is not allowed in the US is because being long and short at the same time is the same as being flat, except that being long and short causes you to pay extra commissions and spread costs. It really becomes a bookkeeping issue - you could keep the long and short positions in your head, and just trade the net in your actual account.

  3. One possible alternative that is 100% legal is to use calendar spreads. You could buy Mar mini S&P, and sell Jun mini S&P. This could get you what you want. BUT, the further out month has much lower volume, so your fills might be worse. And while Mar and June generally move together, there are times where they do not. And some instruments (soybeans, crude oil) sometimes have extreme moves between consecutive months. So, there are additional risks here.

Good Luck, hope this helps!



This is helpful. Thank you.


Glad we could help @Nilesh As I mentioned you can use a platform like Multicharts for your programming or you can use a direct API. We have one customer @FreeToChoose who shared his direct experience with Rithmic API. Read this

Please let us know if you have more questions.

Thank you,
Matt Z
Optimus Futures


Hello @Nilesh

If @Mod-MattZ is within the ballpark of guessing your trading approach, I might have a few ideas for you to consider.

I simulated and then traded live a similar strategy years ago across multiple instruments.

The biggest challenge was to collect enough data to test it across 1) multiple markets (to see exactly how robust it was) and 2) multiple years, as both win rate and profit factor tend to flatten out when subjected to decades of testing (e.g. something that appears to have, say, >50% win rate over a few years often flattens out to 50% or less once you add a decade or more…with the understanding that the trading and market environment tends to change dramatically within those periods).

The next challenge is the actual tick size of the profit range, as the smaller the tick size, the more sensitive it is to slippage. And real-time slippage cannot be accurately tested or predicted in a simulated environment.

I came across a serious dilemma:

Dilemma 1:

  • If the profit range was significantly smaller than the risk (meaning, I was risking more than I aimed to take profit), then my win rate had to be significantly higher on a consistent basis, as any loss on one trade required two or more profitable trades to bring my equity back up to where it was before the loss.

  • The problem with this is that losing streaks are mathematically impossible to predict. So if I came across a losing streak, and if I were using a strict R% (risk percentage) limit, then I would have to have enough capital to withstand a series of losses.

Dilemma 2:

  • If I attempted to lengthen the take-profits or shorten the stop-losses, then I ran into scenarios where both stop-losses were taken out before any profit targets were reached. This often significantly reduced my win rate, worsening my profit factor.

  • At one point I thought of trailing the stop once one of the legs was stopped-out, but then that was impossible (at the time) for me to adequately simulate and hence automate.

It seems as if the purpose of using a hedging strategy would be to reduce speculation (not dissimilar to how “commercials” use hedging to mitigate market risk). But when using hedging in this manner–a very delicate type of trade–it seems not only that you are speculating but that you are adding to speculation one extra level of complexity, which generally cannot be good, as the more complex a system is, the more hidden and asymmetrical the risk it contains.

Perhaps you might want to try some variation of a spread strategy as KJTrading suggested. Or perhaps, you might want to try a simple breakout swing strategy (but using daily charts instead of smaller time frames as the former is less prone to noise and more fundamentally oriented, which may be an aid to technical approaches). Or perhaps, you just might want to speculate on a directional bias, but making it simple enough to better manage your positions and mitigate your risk.

Good luck in deciding what to do. Perhaps you have found a rare approach or tactic to exploit (or a means to approach such a trade in a manner that we have not yet seen…who knows, that is what we, as traders, do). And if you have, and with all encouragement, more power to you!


Thank you. This is very comprehensive and insightful. While the strategy isn’t meant to scalp but to take directional positions in time when S&P makes large swings, I will be mindful of your suggestion. Much appreciated.


Thank you for being open-minded, and considering other people’s futures trading experience.
Often models that look on the paper present quite a few more challenges than you may have anticipated. Also, please consider that the CME has very specific rules about initiating trades, and going long and short constantly may violate some of their rules. While you have a strategy in mind, to the CME it may seem as a “wash” which means you never had any intention to initiate a trade. Again, we would discourage you from such practices.

Thank you,
Matt Z
Optimus Futures