Adding third variable to a backtest

Optuma Forums Optuma Scripting Adding third variable to a backtest

  • This topic has 0 replies, 1 voice, and was last updated 6 days ago by James.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #70551
    James
    • Topics: 22
    • Replies: 12
    • Posts: 34

    backtest scripts: Binary SPY:IEF entry and exit.

    Entry: 3m RS Signal SPY:IEF Bullish IsTicker

    **************************
    I would like to add a third criteria that includes both SPY and IEF relative underperformer to BIL So when SPY and IEF underperform BIL (cash) then it would not invest in either SPY or IEF (above binary scripts)
    – SPY:BIL
    – IEF:BIL

    SPY:BIL
    A1 = GETDATA(CODE=SPY:US);
    A2 = GETDATA(CODE=BIL:US);
    B1 = A1/A2;
    C1 = MA(B1,BARS=65, STYLE=Exponential, CALC=Close);
    C2 = CLOSE(B1) > C1;
    C3 = C1 IsUp;
    V2 = CLOSE(B1);
    V3 = HIGHESTHIGH(V2, BARS=65);
    V4 = LOWESTLOW(V2, BARS=65);
    V5 = V2 > V3;
    V6 = V2 < V4;
    V7 = SWITCH(V5,V6);
    V9 = C2 + C3 + V7;
    V10 = V9 > 2;
    V11 = V9 < 1;
    SWITCH(V10,V11) Equals 0

    IEF:BIL
    A1 = GETDATA(CODE=IEF:US);
    A2 = GETDATA(CODE=BIL:US);
    B1 = A1/A2;
    C1 = MA(B1,BARS=65, STYLE=Exponential, CALC=Close);
    C2 = CLOSE(B1) > C1;
    C3 = C1 IsUp;
    V2 = CLOSE(B1);
    V3 = HIGHESTHIGH(V2, BARS=65);
    V4 = LOWESTLOW(V2, BARS=65);
    V5 = V2 > V3;
    V6 = V2 < V4;
    V7 = SWITCH(V5,V6);
    V9 = C2 + C3 + V7;
    V10 = V9 > 2;
    V11 = V9 < 1;
    SWITCH(V10,V11) Equals 0

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest