Three inside up/down candlestick pattern screener

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #46414 quote
    Marcel van Vliet
    Participant
    Veteran

    Hi, I tried to modify the morning/evening star screener from @Francesco into a Three inside up/down screener. The screener seems to work but picks the pattern anywhere in the past.

    I think the problem starts with identifying the base candle………?????

    Does anybody (@Fransesco?) has an idea how to scan the last recent build patterns only?

    //Author: Francesco modified: Marcel van Vliet
    //Date: 20-01-2017 Date: 16-09-2017
     
    //BaseCandle parameter = first candle of the pattern, starting from right (it is possible to run screener staring from any past candle)
    BaseCandle = 0
     
    Open0 = Open[BaseCandle]
    Close0 = Close[BaseCandle]
     
    Open1 = Open[BaseCandle + 1]
    Close1 = Close[BaseCandle + 1]
     
    Open2 = Open[BaseCandle + 2]
    Close2 = Close[BaseCandle + 2]
     
    Open3 = Open[BaseCandle + 3]
    Close3 = Close[BaseCandle + 3]
    
    Open4 = Open[BaseCandle + 4]
    Close4 = Close[BaseCandle + 4]
    
    //Three inside up
    C1=Open0<Close0 andClose1>Open0 and Close2<Close1 and Close3< Close2 and Open4≤Close3 and Open4<Close4
    
    //Three inside down
    C2=Open0>Close0 andClose1<Open0 and Close2>Close1 and Close3> Close2 and Open4≥Close3 and Open4>Close4
     
    //Go Short Signal = -1
    If C2 then
     Go = -1
    endif
     
    //Go Long Signal = 1
    If C1 then
     Go = 1
    endif
     
    Condition = (C1 or C2)
     
    SCREENER[Condition] (Go AS "Go")
    
    #46554 quote
    Marcel van Vliet
    Participant
    Veteran

    I discovered that the ‘greater than or equal sign’ and the  ‘smaller than or equal sign’ are not valid in PRT language.

    Can anyone, maybe @Nicolas help me out with this?

    Thank you.

    #46561 quote
    Nicolas
    Keymaster
    Master

    The problem in your code is that once you set your ‘Go’ variable to a value, the program keep this value until the code has finished reading the whole data history. You need to reset it to its default state if your C1 or C2 conditions are not true:

    //Go Short Signal = -1
    If C2 then
     Go = -1
    //Go Long Signal = 1
    elsIf C1 then
     Go = 1
    else
     Go = 0
    endif

    It should do the trick, please tell us.

    #46594 quote
    Marcel van Vliet
    Participant
    Veteran

    @Nicolas, Thanks a lot.

    Please, can you post me  the ‘greater than or equal sign’ and the ‘smaller than or equal sign’ which are used in PRT?

    I can’t find this in the manual.

    Thanks you.

    #46595 quote
    robertogozzi
    Moderator
    Master
    IF close >= open THEN //Greater Than OR Equal to
    IF close <= open THEN //Smaller Than OR Equal to
    #46724 quote
    Marcel van Vliet
    Participant
    Veteran

    @robertogozzi Thanks a lot.

    Is it worth the effort to upload the screener for the library?

    #46750 quote
    Nicolas
    Keymaster
    Master

    Is it worth the effort to upload the screener for the library?

    Sure! It could serve as a reference to other users around here 🙂 Thanks for sharing Marcel.

    #46767 quote
    Marcel van Vliet
    Participant
    Veteran

    Here is the result of our ‘author combined screener’ for the three inside up/down candlestick pattern. Unfortunately I only have acces to Euronext stocks and Forex to test it. Is there somebody willing to test it on other securities before I load  it up in the library?

    //Author: Francesco modified: Marcel van Vliet
    //Date: 20-01-2017 Date: 16-09-2017
     
    //BaseCandle parameter = first candle of the pattern, starting from right (it is possible to run screener staring from any past candle)
    BaseCandle = 0
     
    Open0 = Open[BaseCandle]
    Close0 = Close[BaseCandle]
     
    Close1 = Close[BaseCandle + 1]
     
    Close2 = Close[BaseCandle + 2]
     
    Close3 = Close[BaseCandle + 3]
    
    Open4 = Open[BaseCandle + 4]
    Close4 = Close[BaseCandle + 4]
    
    //Three inside up
    C1=Open0<Close0 and Close1>Open0 and Close2<Close1 and Close3< Close2 and Open4<=Close3 and Open4<Close4 and Close4>=Close0
     
    //Three inside down
    C2=Open0>Close0 and Close1<Open0 and Close2>Close1 and Close3> Close2 and Open4>=Close3 and Open4>Close4 and Close4 <=Close0
     
    //Go Short Signal = -1
    If C2 then
    Go = -1
    
    //Go Long Signal = 1
    elsIf C1 then
    Go = 1
    else
    Go = 0
    endif
    
    Condition = (C1 or C2)
     
    SCREENER[Condition] (Go AS "Go")
    
    #46773 quote
    Nicolas
    Keymaster
    Master

    Seems ok on NYSE and NASDAQ stocks lists.

    #46858 quote
    Marcel van Vliet
    Participant
    Veteran

    Ok, Thank you sure enough for me to upload it.

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

Three inside up/down candlestick pattern screener


ProScreener support

New Reply
Author
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by Marcel van Vliet
8 years, 4 months ago.

Topic Details
Forum: ProScreener support
Language: English
Started: 09/17/2017
Status: Active
Attachments: No files
Logo Logo
Loading...