Pivot problems

Viewing 7 posts - 1 through 7 (of 7 total)
  • #9804

    Hello all,

    Im trying to trigger BUYs when the close of a candle is below the daily pivot AND the gap between the pivot is less than 30 points.

    Below is what I thought would do the trick – but Im seeing quite a few BUYs triggered above the pivot – any idea what I’ve done wrong?

    Many thanks, Geoff

     

    // Conditions to enter long positions
    indicator1 = close
    indicator2 = (DHigh(1) + DLow(1) + DClose(1))/3
    c1 = indicator1 < indicator2

    indicator10 = close
    indicator20 = (DHigh(1) + DLow(1) + DClose(1))/3
    c10 = (indicator20 – indicator10) <30

    IF c1 AND C10 THEN
    BUY 2 PERPOINT AT MARKET
    ENDIF

    #9806

    Hi, on which timeframe did you encounter the bugs?

    #9807

    Im using the 1 min chart with the maximum history (11 months)

     

    Is a 1 min chart backtest unreliable?

    #9808

    1 minute timeframe is reliable, no worries, I were just wondering if you were testing the strategy in daily timeframe..

    About the problem, this is strange since your c1 condition is quite strict. I’m not on computer now so I can’t reproduce your bug.

    Can you add a “GRAPH c1” at the end of the code and see what happen?

     

    #9809

    still seeing the problem.. odd…

    #9811

    Of course, the GRAPH instruction is here to debugging purpose only. You should see on your chart an oscillator between 0 and 1 showing you your c1 condition : 1 is true, 0 is false.
    Look at the documentation if you want to learn debugging all by yourself with this useful instruction😉

    #9812

    is see… good tip, thanks…I’ll try to work out whats happening. Im new to this, so apologies for the basic questions…

Viewing 7 posts - 1 through 7 (of 7 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login