Announcement

Collapse
No announcement yet.

backtesting with specified entry level.

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

  • backtesting with specified entry level.

    This question mat be outside the remit of this forum but I'll ask it anyway.
    I have an EFS which changes the bar colour to red when in a downtrend and green for an uptrend. All straight forward stuff.
    What I need to do is 'tweak' the settings by backtesting it. My entry criteria is e.g. 2points above the first green bar of the colour change.
    How do I go about giving it a command to enter at that (high+2)level which could be reached on the following bar or several bars later or not at all, without it just immediately registering an entry price that the market hasn't actually reached?
    I can run a backtest using the bar close but many of the trades are invalid because they did not meet the exact criteria and editing them out is more trouble than its worth.
    Are there any examples of something similar I can look at to try and decipher.
    Many thanks

  • #2
    Hello travis,

    There are many examples here in the forums. You could try searching for keywords in this specific forum. Our Guide to Developing EFS Strategies also covers how to enter trades in back testing a specified stop or limit price levels. In general, you will record the price level where you want the entry to occur based on your green bar signal using a global variable. Then you will add a condition inside main() that will look for the next bar that breaches that price level that will intern execute the Strategy.doLong(Description, Fill Type, Fill Bar, LotSize, StopOrLimit) call at your specified price level when that breach occurs. Give it a shot and if you run into a specific problem, post your code and we'll go from there.
    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