Announcement

Collapse
No announcement yet.

help with backtest please

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

  • help with backtest please

    My problem is that there are no lines of code to test this efs. Can anyone help with a simple reversal strategy, like buy at market on 2nd consecutive green bar - then reverse with 2nd consecutive red bar?...might be interesting.


    Project Description:

    Chandelier Exit/Stop script. 3 Parameters:

    frMult: ATR multiplier value. Default is 2.5.

    frLookback: Number of bars to lookback to find highest/lowest
    stop values. Default is 10 bars.

    frATRLength: Length to use in actual ATR study. Default is
    15 bars.

    If you come across any fixes or have any ideas on how to spruce it up, I
    would appreciate it if you would let me know ([email protected]).

    Dislaimer: For educational purposes only! Obviously, no guarantees
    whatsoever and use at your own risk.

    ************************************************** ********************/

    //User Parameters
    var nLength = 15; //ATR Length (length used in ATR study)
    var nLookback = 10; //Lookback period for Min/Max value
    var nMult = 2.0; //ATR Multiplier

    //Global Variables
    var grID = 0;

    var atrStudy = null;
    var aLValue = new Array();
    var aSValue = new Array();

    //== PreMain function required by eSignal to set things up
    var vATR14 = new ATRStudy(9);
    var vDonchian = new DonchianStudy(20, 0);
    var vLastAlert = -1;

    function preMain() {
    setPriceStudy(true);
    setStudyTitle("atr");
    setColorPriceBars(true);
    }

    function main() {
    setPriceBarColor(Color.yellow);

    if (
    high() >= vDonchian.getValue(DonchianStudy.LOWER, -1)+2.5*vATR14.getValue(ATRStudy.ATR)
    ) onAction1();

    if (
    low() <= vDonchian.getValue(DonchianStudy.UPPER, -1)-2.5*vATR14.getValue(ATRStudy.ATR)
    ) onAction2();

    return null;
    }
    function onAction1() {
    setPriceBarColor(Color.lime);
    vLastAlert = 1;
    }

    function onAction2() {
    setPriceBarColor(Color.red);
    vLastAlert = 2;
    }
Working...
X