Announcement

Collapse
No announcement yet.

using formula in backtesting strategy

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

  • using formula in backtesting strategy

    I have an efs formula started in formula to go Long in the trade, but am unsure how how to add my sell signal so my backtesting results work.

    here is what a have to enter a buy signal:
    if (
    vStoch25_3.getValue(StochStudy.SLOW) > 20 &&
    vStoch25_3.getValue(StochStudy.SLOW, -1) < 20
    ) onAction1();


    What I thought might work to get the opposite sell signal, would be this:
    if (
    vStoch25_3.getValue(StochStudy.SLOW) > 20 &&
    vStoch25_3.getValue(StochStudy.SLOW, -1) < 20
    ) onAction1(); //buy


    if (
    vStoch25_3.getValue(StochStudy.SLOW) < 80 &&
    vStoch25_3.getValue(StochStudy.SLOW, -1) > 80
    ) onAction2(); //sell

    all indicators disappear when I do that so not what to do

  • #2
    stvchez
    If you post the efs someone may be able to help.
    Alex

    Comment

    Working...
    X