test the relative bias filter

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39937 quote
    victormork
    Participant
    Veteran

    Hi, I would like to do some testing on the relative bias filter posted by Maz in the indicator library. I would like to just try generating a sell signal when the result line is coming down fro

    DEFPARAM CumulateOrders = false
    // Variables
    response    = 20
    cutoff      = 5
    dynamicMode = 1 // true | false
    
    
    once cutoff   = min(45, max(1, cutoff))
    once response = max(2, response)
    once btm = 0   + cutoff
    once top = 100 - cutoff
    if dynamicMode then
    period = response*2 //200
    endif
    ar = rsi[response](average[period](TypicalPrice))
    resultLine = min(top, max(btm, ar))
    
    sc1 = resultline < 95
    sc1 = sc1 and resultline[2] > 95
    
    If sc1 then
    sellshort 1 contract at market
    endif
    
    If shortonmarket and resultline > resultline[1] then
    exitshort at market
    endif

     

    m the top cut off line. However I have not managed to get the code right. Is there any suggestions on solve my problems?

    #40216 quote
    Nicolas
    Keymaster
    Master

    Your problem is that your “resultline” variable is never higher than 95, so obviously the “sc1” condition is never fulfilled and no orders are triggered 🙂

    #40346 quote
    victormork
    Participant
    Veteran

    thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

test the relative bias filter


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
victormork @victormork Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by victormork
8 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/06/2017
Status: Active
Attachments: No files
Logo Logo
Loading...