Announcement

Collapse
No announcement yet.

Inter-bar actions

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

  • Inter-bar actions

    Hi. Could anyone advise me it there is any way of running a backtest that monitors the price action within the time frame of a bar and trades accordingly.

    For example if I am trading on five minute bars and have entered a position with a MA crossover on this basis, is it possible to exit the position immediately upon the market price falling 10 point/pips below the entry price, or does that exit need to wait for the end of the 5 minute period/bar ?

    I have only been able to come up with scripts that exit at period end.

    Being able to exit within the period would replicate real stop losses in the market, and will make a big difference to results when trading highly levered forex positions in fast markets.

    Any help would therefore be most appreciated !

    thanks, Nigel.

  • #2
    Hello Nigel,

    Backtesting formulas only processes on completed bars. We don't have access to the individual trades that create each bar on a historical basis. What you need to do is write your conditions to test the opening price and range of the bar relative to your stop or entry target and then use the .STOP or .LIMIT trade types. The price that you will pass in the trading functions will be an approximate price where your trade would have occurred. Make sure that the price used for the trade exists within the range of the bar where the trade is to occur. The Strategy Analyzer will accept what ever price you pass, so you'll need to add a condition to ensure you're using a realistic price just before calling the respective function.
    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


    • #3
      intra Bar trading

      Jason,

      I am trading an automated trading program with a moving average crossover system. I want to trade intra bar, in and out over the mov. avg. What I need is a DELAY time system to trigger a trade when it cross the avg. by a set determined amount, say, 2-30sec.

      Can you show me in code how this is done in real time, or point me in the right direction for examples?

      Thanks!
      Angelo
      ang.

      Comment


      • #4
        Hello Angelo,

        We don't have a timer in EFS. See my reply in this post for more details and an alternative solution.
        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