My screener ignores MFI[40] condition

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #113939 quote
    assafn
    Participant
    Average

    Hello,

    I’m using several conditions but one of them (mfi[40]) is ignored by the screener.

    I attached a screen shot that shows the two versions of the code and one of its results.

    What am I doing wrong?

    1-2.png 1-2.png 2-1.jpg 2-1.jpg 1-2.jpg 1-2.jpg
    #113948 quote
    Vonasi
    Moderator
    Master

    In your screenshot MFI has a value of 79 so is not less than 35 so that instrument is not one that the screener will find.

    When posting code please use the ‘Insert PRT Code’ button rather than post screenshots of it as that way others can easily copy the code to test it. With a screen shot you are expecting them to retype the whole code!

    #113951 quote
    assafn
    Participant
    Average

    I’m not at home right now so won’t be able to send the code. The problem I have is that the FOXA stock *did* came as a result from that code.

    Do you see any problem with the code?

    #113954 quote
    Nicolas
    Keymaster
    Master

    You are comparing a real-time value of a 40 periods calculation of the Money Flow Index indicator with its value 40 periods ago.. That’s where is the trouble I believe 😉

    If you want to offset 40 periods ago an indicator, the syntax should be like this:

    moneyflowindex[14][40]

    MoneyFlowIndex instruction.

    #113957 quote
    assafn
    Participant
    Average

    Thank you Nicolas. So if I want the 40 periods calculation of the current bar, it should be like this?

    Moneyflowindex[40][0]

    #113968 quote
    assafn
    Participant
    Average

    I’ll try again…

    I wanted to create a code for the screener that will show results if the previous period meets its conditions:

    1. MFI (40 periods) is smaller than 35.

    2. CCI (40 periods) is smaller than 0.

    3. Close is bigger than Open

    4. Price is bigger than 10$

    The screener will show first high volume stocks.

    Again, all condition should apply for the previous period.

    This is the code:

    indicator1 = MoneyFlowIndex[40]
    c1 = (indicator1[1] < 35)
    indicator2 = CCI[40]
    c2 = (indicator2[1] < 0)
    c3 = (close[1] > open[1])
    c4 = (close[1] > 10)
    
    criteria = Volume
    
    SCREENER[c1 AND c2 AND c3 AND c4] (criteria AS "Volume")
    

    Some of the results of the screener have an MFI[40] value that is bigger than 35.

    The time frame is 15 minutes.

    I attached a screen shot.

    Thank you.

    1-3.jpg 1-3.jpg
    #113982 quote
    Nicolas
    Keymaster
    Master

    It works good for me on NASDAQ list, see attached screenshot.

    Do you have real-time data subscription for the lists you are working on with the screener?

    money-flow-index-screener.png money-flow-index-screener.png
    #113986 quote
    assafn
    Participant
    Average

    I changed the code to how you wrote it, but the value of the criteria as shown by the screener doesn’t match the value in the graph (see screenshot).

    I’m using IG demo account.

    1.jpg 1.jpg
    #113989 quote
    assafn
    Participant
    Average

    BTW @Nicolas, this problem happens only with the screener. The code works perfectly when I use it as backtest.

    #113990 quote
    Nicolas
    Keymaster
    Master

    You should try with a real account.

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

My screener ignores MFI[40] condition


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
assafn @assafn Participant
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by Nicolas
6 years, 3 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 11/30/2019
Status: Active
Attachments: 6 files
Logo Logo
Loading...