Simple Time Scan?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9681 quote
    Stephen24612169
    Participant
    New

    Hey Guys.

    Could  someone please tell me what the code is for the (daily) 50EMA to have been above the 200EMA for the last 3 months?

    Thank you.

    Stephen

    #9786 quote
    Stephen24612169
    Participant
    New

    Can anybody help me with this?

    #9797 quote
    Nicolas
    Keymaster
    Master

    Do you got coding knowledge already? If yes, please look at how to make loop in the past to test if your MA50 is above the MA200, if yes do a variable incrementation and if this variable >= 3Months*20Days, you got what you were looking for.

    #9862 quote
    Stephen24612169
    Participant
    New

    Thank you for your reply Nicholas. I do not have much coding experience. What would be the code for what you say?

    #9868 quote
    Nicolas
    Keymaster
    Master

    Here is the code you need to test if the MA50 was above the MA200 in the last 60 bars :

    MA50 = average[50](close)
    MA200 = average[200](close)
    
    count = 0
    for i = 1 to 60 do 
     if MA50[i]>MA200[i] then 
      count = count +1
     endif
    next
    
    if count=60 then 
     result = 1
    else 
     result = 0
    endif
    
    
    
    qigley thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Simple Time Scan?


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Nicolas
9 years, 8 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 06/22/2016
Status: Active
Attachments: No files
Logo Logo
Loading...