I found a bug

Viewing 5 posts - 1 through 5 (of 5 total)
  • #234163

    The indicator bellow, if I try to attach it to a chart is says “A positive integer field is expected with round”

    Two things, that is a weird message because it surely should expect a floating point field, secondly “round()” is not used within the indicator! although it was in a previous iteration. Please advise?

    timeframe(1 hour,updateonclose)

    trend=MACD[12,26,9](close)
    BolUp1,BolDown1, BolUp2, BolMiddle, BolDown2, BolUp3, BolDown3, BolUp1Direction, BolDown1Direction, BolUp2Direction, BolDown2Direction=CALL “#HourlyBollinger”

    T1Status=call “#T1″[0]

    timeframe(5 Minute, updateonclose)
    signal=0

     

    if OpenHour >=8 and OpenHour <=15 then

    //Long R1
    if tR1 and close>open and BolDown1Direction>0 and low<=BolDown1 and close>BolDown1 and high<BolMiddle then
    signal=low-0.5
    endif

    //Short R1
    if tR1 and close<open and BolUp1Direction<0 and high>=Bolup1 and close<BolUp1 and low>BolMiddle then
    signal=high+0.5
    endif

    //Long R2
    if tR2 and close>open and BolDown2Direction>0 and low<=BolDown2 and close>BolDown2 and close<BolDown1 and high<BolDown1 then
    signal=low-0.5
    endif

    //Short R2
    if tR2 and close<open and BolUp2Direction<0 and high>=Bolup2 and close<BolUp2 and close>BolUp1 and low>BolUp1 then
    signal=high+0.5
    endif

    endif

    if tT1 and T1Status[1]=0 and T1Status=1 then
    signal=low-0.5
    endif

    if tT1 and T1Status[1]=0 and T1Status=-1 then
    signal=high+0.5
    endif

    if tT2 and T1Status[1]=0 and T1Status=2 then
    signal=low-0.5
    endif

    if tT2 and T1Status[1]=0 and T1Status=-2 then
    signal=high+0.5
    endif

    return signal as “Signal”

     

    #234166

    It seems the issue is related to switching time frames, I managed to find a work around, by returning unrounded values from #HourlyBollinger and then rounding them in #Signals within the 5 minute timeframe.

     

    The tine frame switching feature, seems a little flaky

    #234167

    It seems the issue is related to switching time frames, I managed to find a work around, by returning unrounded values from #HourlyBollinger and then rounding them in #Signals within the 5 minute timeframe.

     

    The time frame switching feature, seems a little flaky

    #234170

    While writing this, you posted your work around message, this is what I was thinking.

    Usually when I get, ‘a Positive integer field’ in error message, it means an index value, is either, not an integer or its less than 1 or 0, some index values don’t like being zero.

    The fact that ’round’ is mentioned, would lead me to believe that the parameter for setting number the decimal places could be out of bounds.

    I can see you ‘call’ other indicators, the problem could be in there. #T1, sends value ‘0’, or in a stock code segment.

    Based on a couple other posts, using different time frames can give different values between code and chart. I always verify now.

    Failing finding    anything obvious, try to isolate, what part of code throwing error.

     

    #234182
Viewing 5 posts - 1 through 5 (of 5 total)

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