EasyLanguage CloseD(1) problem with futures

Discussion in 'Strategy Development' started by travis, Oct 25, 2009.

  1. travis

    travis

    I have a problem that I can't fix, in easylanguage.

    If I ask for yesterday's close, by using the "CloseD(1)" function on futures data (continuous trading), it does not return the last close of the session (at about 4 PM EST), but the last close of the 24 hour day (right before midnight - 8 hours later), which falls within the second session. This means that I am testing one system (with the close at midnight), but I will be automating a different system, unless I use tradestation, because all brokers by "yesterday's close" mean the close at around 4 PM EST, at the end of the (future contract) session. This problem is particularly critical now that I am developing a system on the opening gap.

    Did anyone have this problem and could you please tell me how to fix it? Thank you.
     
  2. it's not an EL problem. You need to backtest on RTH data only.
     
  3. Well, there's different "workarounds" for this type of issue. One solution would be to designate a "new" synthetic symbol with the hours you want for this purpose and have it as data2 or dataxx.
    There's probably other ways as well, depending on your overall code complexity.
     
  4. another solution would be to create a new function where the value is saved at the
    time you wat it to be saved, right now it saves wenn D > D[1] in other words wenn a new date is found.
    Be aware your other functions like HighD and LowD will face the same problem as they will keep calculation untill a new date is found.
    easyest way would be to create a new symbol which has the times decreased just the way you want it
     
  5. travis

    travis

    Great. Thank you all. The solution you all seem to agree on is to change the schedule of the future. It will work for sure (I won't even need data2 probably). Thanks.
     
  6. Use @es.d not @es. Another solution is use @es but create a new "session" type and give it the hours for the @es.
     
  7. travis

    travis

    Thank you very much.