Announcement

Collapse
No announcement yet.

Backtest pre determined entry date & time

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Backtest pre determined entry date & time

    I have a proprietary indicator for MT4 that is giving good entry signals for forex. I want to backtest the best exit strategy.

    I am leaning towards fixed Take Profit for 1/2 position, remainder using trailing stop, bringing stop to BE when 1/2 closed. Fixed initial stop until 1/2 closed. I want to test different stop combinations.

    With some struggle I think I can manage the above using one of the tutorial sample efs files.

    My problem is that I want to initialze the trade referencing a list of date/time and Long / Short for entry rather than an eSignal indicator or price condition.

    I would like to use a table of perhaps 30 days of trade entries, possibly needing 40 trades.

    It makes sense to increase the table index each time a trade is entered to earlier date/times dont have to be checked again as the data scrolls forward.

    Any help for this last part, or all of it would be greatly appreciated.

    Thanks, Dave

  • #2
    Hello Dave,

    To reference the date and/or time of each bar during back testing, you can use the following Series Functions, day(), month(), year(), hour(), minute() and second(). Your list of dates/times could be stored in a global array. As your formula evaluates each bar, loop through your array and compare the bars' date/time to your array to find the bars where you want to record your trades. There is an example of a for loop in the link for the array object. If I've misunderstood what you're trying to accomplish, please provide further details.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X