Announcement

Collapse
No announcement yet.

Backtesting probs

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

  • Backtesting probs

    I need some help please. When I use Strategy.doLong to create a trade at a trigger level on the current bar, but that trigger then proves false because the close(0) is lower than the trigger point I want to be able to Strategy.doShort on the next bar to reverse out of it. No matter what I do it will not work! Attached is how this looks within my script. What's the problem??

    Thanks
    Attached Files

  • #2
    Hello greffel,

    We need to see your complete formula in order to answer your question about why your formula isn't executing as you are expecting.

    Just as a word of advice based on the funtion you provided. You may be creating some unrealistic results with your back testing formula by making decisions on the current bar based on the open and close price of the next bar in the future. In my opinion, by doing so, your results would not be valid as this strategy is only possible in a back testing environment. When converting your strategy to a real time study, you will not know the open and close price of a future bar, so your conditions that determine the .doShort calls will fail. Instead, you should check for BARSTATE_NEWBAR and look back at bar -1 to make decisions depending on your current position etc.
    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