Hour conditions based bug in ProBuilder

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #112952 quote
    Nicolas HerveNicolas Herve
    Participant
    New

    Is this a bug ?
    The following code always return 4.

    if Hour >= 22 or Hour<1 or (Hour=1 and minute<15) then
      spread = 4
    elsif Hour = 17 then //and minute >= 30 or Hour >= 18 then
      spread = 2
    elsif hour >= 9 then
      spread = 1
    elsif hour >= 8 then
      spread = 2
    else
      spread = 3
    endif
    
    
    return spread
    // this code always return 4 !!????

    But this works perfectly in ProBackText/ProOrder

    if Hour >= 22 or Hour<1 or (Hour=1 and minute<15) then
      spread = 4
    elsif Hour = 17 then //and minute >= 30 or Hour >= 18 then
      spread = 2
    elsif hour >= 9 then
      spread = 1
    elsif hour >= 8 then
      spread = 2
    else
      spread = 3
    endif
    
    Graph spread as "spread"
    
    if 0 then
      buy at market
    endif
    

     

    Did I miss something ? Or isn’t this a bug ?

    Also same code runs faster in ProBackTest  than in ProBuilder (even working code)

    #112995 quote
    NicolasNicolas
    Keymaster
    Legend

    Please try to write a topic title more explicit next time! And please update your profile by selecting your country.

    The first code (indicator) runs correctly for me on 5-minutes timeframe. What timeframe and instrument did you check?

    #113064 quote
    Nicolas HerveNicolas Herve
    Participant
    New

    Thank you for testing the code.
    I am using tick time frame.

    p.s.: Yeah I’m new to this forum.

    #113087 quote
    NicolasNicolas
    Keymaster
    Legend

    I have indeed the same issue on tick-charts. I will try to know more about it and let you know.

    #113279 quote
    NicolasNicolas
    Keymaster
    Legend

    This is a problem specific in v10.3 (not present with new version 11). You should be able to get rid of the issue by using this kind of code instead:

    MyHOur=Hour
     
    if MyHour >= 22 or MyHour<1 or (MyHour=1 and minute<15) then
    spread = 4
    elsif MyHour = 17 then //and minute >= 30 or MyHour >= 18 then
    spread = 2
    elsif MyHour >= 9 then
    spread = 1
    elsif MyHour >= 8 then
    spread = 2
    else
    spread = 3
    endif
    
    return spread
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Hour conditions based bug in ProBuilder


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by NicolasNicolas
6 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/16/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...