Monthly Inside Bar Breakout Failure

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #139045 quote
    revstratrevstrat
    Participant
    New

    I have been trying to code a monthly version of the inside bar breakout failure for a while but to no avail. Below is the code I use for Daily and Weekly.

    c1= high[1] < high[2]
     
    c2= low[1] > low[2]
     
    insidebar = c1 and c2
    insidebarbreak = high[0]>high[1] or low[0]<low[1]
    reversal = close[0]<high[1] and close[0]>low[1]
    
    insidebarfailure = insidebar and insidebarbreak and reversal
    
    screener[insidebarfailure]

    This is my attempt at the monthly

    ////CURRENT MONTH Open & Close////
    If Month<>Month[1] then
    MCOpen = Open[0]
    endif
    
    MCClose = Close[0]
    
    ////CURRENT MONTH High & Low////
    
    //unsure and stuck here
    
    ////PREVIOUS MONTH Open & Close////
    If Month<>Month[1] then
    MCOpen = Open[1]
    endif
    
    MCClose = Close[1]
    
    ////PREVIOUS MONTH High & Low////
    If Month<>Month[1] and barindex>20 then
    MPHigh = Highest[BarIndex - lastMonthBarIndex](High)[1]
    MPLow = Lowest[BarIndex - lastMonthBarIndex](Low)[1]
    lastMonthBarIndex = BarIndex
    ENDIF
    

    As you can see I am stuck trying to get this month’s or the current month’s High and Low. Any suggestions or tips? Thank you.

    #139066 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    //MONTH OHLC //
    //
    If Month<>Month[1] then
       MCClose  = close[1]  //close of previous month
       MCOpen = CurOpen     //open of previous month
       CurOpen = open       //open of new month (current month)
       MPHigh = CurHigh     //previous monthly high
       MPlow   = CurLow     //previous monthly low
       CurHigh = high        //new monthly high
       CurLow  = low         //new monthly low
    ENDIF
    CurHigh = max(CurHigh,high) //update High
    CurLow  = min(CurLow,low)   //update Low
Viewing 2 posts - 1 through 2 (of 2 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

Monthly Inside Bar Breakout Failure


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
revstrat @revstrat Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years, 2 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 07/12/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...