Robot Trading on futures - ES et al

Discussion in 'Journals' started by iuykcif, Sep 3, 2009.

  1. iuykcif

    iuykcif

    Understood you perfectly. I was actually referring to eusdaiki, using your quote to reinforce.


    Update next hours

    <a target="_blank" href="http://www.datatime.eu/public/TradingDiary/FuturesDiary.htm"> Diary Appended next hours... to be continued</a>

    I leave everything open to test how far I can go with the game...

    Tomorrow I will probably delete the previous ticks or else the chart become too cluttered and useless.


     
    #21     Sep 3, 2009
  2. Impressive results...

    What is the difference between Realized and Unrealized profits.

    Are commissions included in these calculations?

    I see a line on your graphs linking the short and long accounts. What is this and How are these two accounts settled?

    If I understand properly you are using two accounts to hedge one another scalping oscillations.

    Maximum difference between the two accounts is 2 contracts? If the accounts are net margined is the margin for 2 contracts all the funding that is needed?
     
    #22     Sep 3, 2009
  3. iuykcif

    iuykcif

    Thanks PocketChange, I am glad to have your approval. It's a big honor.

    Let's see if I succeed answering your interesting questions, and please forgive my language errors.

    I am also glad that my user name has been polished :))

    By Realized and Unrealized I am following the same terminology used by IB.

    Let's make an example. Assume you have placed, one after another 100 orders buy and sell.

    o1 o2 o3 .... o100

    Let's start from the last order and go back. At a certain point you may find one order such that the global position after that order is 0.
    Or you may not.

    Assume such a order exists and is o(j).

    All you have profited/loss until o(j) is the Realized. What you are profiting/losing from o(j) is the Unrealized.

    I hope I have explained well.

    In case of this particular strategy, since it proceeds without stops (substituted by a continuous hedging action) you are guaranteed that whatever amount you see as Realized, it will eventually become P&L.
    The only case where this may not hold true is if the account is subject to liquidation (therefore you must have enough deposit to hold) or you are still playing with the futures contracts near the expiry (clearly you wouldn't).

    Yes commissions are fully included and you can see them in the column "Comms".
    [As a humorous note I have been thinking if I should have used the red or green color for them!! Apart that too much red is depressing ;-) a consideration can be done that's something I am actually "gaining", although I give it to the Broker, for his services.]

    About the lines you see, they are a leftover of other strategies, but the may make sense even here and I think I will leave them. The meaning is as follows.

    A line joins 2 orders: such that the first order has been open when the position was zero, and the second order has been closed causing the position to become 0. In other words you can see them as start and end of a "trade", where by "trade" i mean all the orders included between 2 0 positions.

    >If I understand properly you are using two accounts to hedge one another scalping oscillations.

    Yes you understood perfectly. There is a double hedging action. Actually in this particular version I am testing, which is much less profitable because constrained I am also testing the conceptual device of disabling the scalping in one direction when it conflicts with the pursue of a balanced situation between accounts.

    >Maximum difference between the two accounts is 2 contracts? If the accounts are net margined is the margin for 2 contracts all the funding that is needed?


    That's right. And the Exchange allows that. The problem is that some brokers do not. Unfortunately I am afraid that also IB does not. (I do hope to be confuted.)


     
    #23     Sep 3, 2009
  4. Thanks for the explanation...

    One question leads to another.

    Is this a discretionary trading system? How are entries selected and managed?

    Does this system provide a trading signal or actually place and manage the orders and positions cradle to grave?

    I am not familiar with your double hedging concept. I understand how two accounts can scalp oscillations but how does the system handle/prevent deep drawdowns from large one sided movements?

    Does the system stop and reverse or just change the directional weighting using the 2 contract difference you referenced?

    Does the system go flat daily or does it hold positions open through sessions?

    If it is always in how do you manage market gaps?

    Finally, under what circumstances does the system break down?
     
    #24     Sep 3, 2009
  5. iuykcif

    iuykcif

    >Is this a discretionary trading system?

    Ahah, you are mocking me, right ? :)))


    How are entries selected and managed?

    Entries are not managed. Can entry at any time. I mean the first entry of each "trade" (as defined in the previous post) of course. The following are based on scalping/hedging needs.

    To understand this concept, assume you have collected all the ticks and are performing a backtest. Then you may eliminate any random portion of any trading session, but the strategy will continue to perform, statistically speaking, in the same way. You may call this "robustness".

    Actually in my strategy selection I use an index of robustness which is based on this concept. For instance, if you have a day trading strategy, to be robust it must maintain its statistical properties, even if the start point of the daily session is shifted randomly.

    If you do not do so the computer will overfit immediately any set of data.

    Your backtests are exceptional, but when you trade it forward you lose even your underwear.

    That's called overfitting. And it's it's the big enemy of the algorithmic trader.
    Any strategy based on "signal" is practically untestable wrt to robustness, and will overfit.

    > cradle to grave ? :)

    Yes. You may say so if you like. Everything is managed real time.


    >how does the system handle/prevent deep drawdowns from large one sided movements?

    It doesn't. Drawdowns cannot be "prevented", and without them you cannot be profitable: they are part of the strategy. The scalping is all a game where you turn eventually the "drawdown" into profits. Clearly larger drawdowns require more time and more deposit on the account, smaller drawdowns make you rapidly rich. We are capturing oscillations. They are all good. The smaller ones are better, but if we can hold, also the big one are good.


    >Does the system stop and reverse or just change the directional weighting using the 2 contract difference you referenced?

    No I have canceled those 2 words (stop and reverse) from my vocabulary


    >Does the system go flat daily or does it hold positions open through sessions?


    If you are P&L > 0 it's up to you. If you are negative, must go overnight because you are "preparing tomorrow's profit".

    >If it is always in how do you manage market gaps?

    Gaps are not harmful. Remember what I said about "robustness". If they profitable the Bot grab them immediately. If they are not it will recover through the next oscillations.


    >Finally, under what circumstances does the system break down?

    I said this in a previous post.
    The system by construction balances between 2 accounts so the overall risk is low. The problem is that on each account the position can grow large.
    So if you play with positions too large wrt the money you have in the account and you are liquidated, you are actually taking a loss. Same if you arrive at expiry and you are still holding contracts.

    In other words to be real safe one must have large capitals on the accounts (unless your broker allows to net margins).


     
    #25     Sep 3, 2009
  6. I get it now...

    If the two accounts are net margined your maximum draw down is just on max 2 contracts less the scalps.

    From your graphs you may be Long 11 and Short 9 controlling 20 contracts but the system is always scalping 1 or 2 contracts each oscillation even while being drawn down.

    When your scalps + the net position is > profit target do you close out and start over? Do you scale out?

    Actually seems like a smart way you are able to synthetically size fractional contracts priced in fractional increments. Can this system even trade in a single account? Wouldn't the positions just offset and closeout?

    Do your daily profits correlate to a set percentage of the linear price movement? Is it viable to scalp 50% of the linear market movements?

    I think your on to something...






     
    #26     Sep 3, 2009
  7. iuykcif

    iuykcif

    >If the two accounts are net margined your maximum draw down is just on max 2 contracts less the scalps

    Yes, in this case I have enforced this constraint. But one could enforce any other number.

    Or one could put no limits. In any case even putting no limits the difference in positions of the accounts doesn't grow very large.

    I still have to study this aspect, but I suspect that it practically remains within a small range.

    If so, it's much better to remove the constraint because it's *very* harmful to profits. It's like running having your feet tied.

    Here i am forward testing the less profitable and adverse scenario.

    So we are not talking of one strategy actually, but infinite variants can take place.

    *** Another very powerful idea, which probably cannot be translate directly
    with Futures is the following (if you think it can please ADVISE!!).

    If you trade opposite pair of ETF is practically no risk. Take for instance the pair SPY/SH.

    In this case, when one ETF exceeds in a positive position long the other one does the opposite. So you are running a already neutral strategy on a neutral pair. What do you want more from life ?

    The difference is that with the futures the whole game is like being "accelerated". And clearly much more dangerous. (I would suggest it only to really **big** investors who can backup the strategy with large capitals when necessary.)

    Or else go the ETF way, which is probably *much* more relaxed and financially viable.

    >When your scalps + the net position is > profit target do you close out and start over?

    Yes you got it. I am closing out and starting over. You could run without closing at all. But I prefer doing so also for psychological reasons, because it's more attracting to see explicitly the realized profits instead of letting them "hidden" within the unrealized.

    > Do you scale out?

    Don't get the question. If you mean dynamically adjusting the scalp packet size, that could be another idea and strategy variant.

    > Can this system even trade in a single account? Wouldn't the positions just offset and closeout?


    Ahh here the questions get tougher.
    Conceptually one would think that whatever you do with 2 accounts you could do with 1, and saving commissions.

    For instance if you are:

    Long 2
    Short 1

    this would be the same as being:

    Long 1
    Short 0

    In other words, whatever logic you have on 2 accounts, you can "project" it on 1 account, by trading the result of composing the two.

    Simple no? Actually I am not so sure. I must think the question through yet, but I have kind the feeling that there exist some special 2-account strategy which are not "projectable" on one account, even if the two trading scheme are independent. (And this one may be one of those special strategies.)

    This seems, and actually is, counter intuitive. It's just a feeling I have (and if true it could be a nice math theorem to be proven). I did not have time to explore this formally.


    >Do your daily profits correlate to a set percentage of the linear price movement? Is it viable to scalp 50% of the linear market movements?

    I am not sure to get what you mean. The profits seem to grow linearly with the scalp packet size. And I think this is intuitive.

    >I think your on to something...

    I also think periodically I am on to something. But after a while I am always beginning a new strategy quest... :))


     
    #27     Sep 4, 2009
  8. iuykcif

    iuykcif

    Thanks. That's real good news.

    Do you have pointers to these reduced margins offering?

    >because of the CME's margin allowances for hedged positions

    That's beautiful. But how come brokers do not seem to comply ? For instance how about the most popular Brokers?



     
    #28     Sep 4, 2009
  9. iuykcif

    iuykcif

    Got curious to try without constraints.

    I have been running for 1 hour on ES, YM.

    Scalp range is 1 point and 5 points.

    Currently :

    Realized

    ES 1,253.00 $
    YM 1,235.89 $

    max P&L seen 2,703 $

    current 1,810 $

    Margin requirements I see are, however, quite high (IB), over 150K.

    <a target="_blank" href="http://www.datatime.eu/public/TradingDiary/ES-2009-09-04-1Hour.gif"> ES-2009-09-04-1Hour.gif </a>
    <a target="_blank" href="http://www.datatime.eu/public/TradingDiary/YM-2009-09-04-1Hour.gif"> YM-2009-09-04-1Hour.gif </a>
     
    #29     Sep 4, 2009
  10. iuykcif

    iuykcif

    Now P&L about 3.500 $ (2 hours trading)

    It's a fast game, I can't type it's already changed...


    Running unconstrained seems definitely more profitable.

    <a target="_blank" href="http://www.datatime.eu/public/TradingDiary/ES-2009-09-04-2Hour.gif"> ES-2009-09-04-2Hour.gif </a>
    <a target="_blank" href="http://www.datatime.eu/public/TradingDiary/YM-2009-09-04-2Hour.gif"> YM-2009-09-04-2Hour.gif </a>
     
    #30     Sep 4, 2009