price closes more than 5 points higher than N candlesticks ago

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #153450 quote
    CapnCrunch77CapnCrunch77
    Participant
    Junior

    Hello folks,

    Does anyone know how to express points move in code?  for example, if a price closes more than 5 points higher than N time frames ago, I want to see a signal (the latter I know how to do, it’s the first part which I’m struggling with!)

    Thanks

    #153452 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Variable Cond will either be true (1) or false (0):

    Cond = close > (highest[5](high[1]) + 5 * pipsize)

    actually any value <> 0, not just 1, is considered to be true.

    CapnCrunch77 thanked this post
    #153459 quote
    VonasiVonasi
    Moderator
    Master

    Roberto’s code will return true if the current close is 5 pips higher than the highest high in the last 5 candles. If you just want it to be 5 pips higher than the close 5 candles ago then you need to use:

    Cond = close > (high[4] + (5 * pipsize))
    
    
    CapnCrunch77 thanked this post
    #153504 quote
    CapnCrunch77CapnCrunch77
    Participant
    Junior

    Thank you both!!

Viewing 4 posts - 1 through 4 (of 4 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

price closes more than 5 points higher than N candlesticks ago


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/12/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...