Announcement

Collapse
No announcement yet.

Simple formula based on Day and Time

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

  • Simple formula based on Day and Time

    Jason K,

    I understand you are the best out there for formulas. Hope you can help me. This may seem a little simple but I don't know how to do it.

    What I would like is a backtesting formula that would Buy on a specified Day and Time and then Sell on a specified Day and Time. The Buy and Sell may occur on the same day or may Buy on a day and Sell on as many as 7 days later. These must occur as different times so I would need to be able to specify that. Of course this would for different stocks instead of just one stock.

    If possible, I would like to put a string of up to 5 Buy/Sell trades together over a period of no longer than 7 days.

    Can this be done?

    Thanks.

    David Stone

  • #2
    Hello David,

    You should be able to accomplish this formula. It's not very clear to me what your logic is for the trade conditions. At any rate, date and time values of the bars are accessible in EFS, see day(), month(), year(), hour(), minute() and second() Series Functions.

    If you need to learn more specifics on how to write back testing formulas, please start with the Back Testing Tutorials. If you need to learn more about general programming in EFS, you may also want to visit the other resources listed below my signature.

    As you begin developing your formula, if you run into more code specific questions, please post them to the appropriate forum along with the code you're working on.
    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