Multiple crossings at different times

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #69050 quote
    fredrikfx
    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?

    #69057 quote
    robertogozzi
    Moderator
    Master

    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
    fredrikfx
    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.

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 fredrikfx
7 years, 9 months ago.

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