Multiple crossings at different times

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #69050 quote
    fredrikfxfredrikfx
    Participant
    Junior

    Hi guys!

    I need help to define a specific situation in code. Can´t figure out how to set these conditions.
    My goal is to define a buysignal when following happens:

    EMA 30 first crosses over EMA 80 and then crosses over EMA 200.

    If i set the condition EMA30 CROSSES OVER EMA80 AND EMA200, then it means that these line crossings happen same time, right? I just want it to happen if it crosses both lines with a maximum of a few hours between the crossings.

    Is it possible to define this?

    crossing.png crossing.png
    #69057 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go (both crossings occurring 3 candles apart at most, all within the last 4 candles):

    if summation[4](EMA30 CROSSES OVER EMA80) AND summation[4](EMA30 CROSSES OVER EMA200) then
    
    manel thanked this post
    #69087 quote
    fredrikfxfredrikfx
    Participant
    Junior

    Thank you so much Roberto!

    AlgoAlex thanked this post
Viewing 3 posts - 1 through 3 (of 3 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

Multiple crossings at different times


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
fredrikfx @fredrikfx Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by fredrikfxfredrikfx
8 years, 5 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/24/2018
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...