Close of last x candels above sma

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #93073 quote
    guitarrockerguitarrocker
    Participant
    Average

    Hi guys,

    How can I define the No. of candles? e.g.:

    IF (close and close[1] and close[2] and close[3] and close [4] and close… (ALL candlecloses up to x) > sma[50]) and RSI>50) THEN
    BUY 1 CONTRACTS AT MARKET
    SET STOP pLoss 10
    SET TARGET pPROFIT 20
    ENDIF

     

    Thanks in advance!

    #93080 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    To check that conditions are met for ALL “x” periods:

    IF summation[x](close > sma[50]) = x THEN

    For just more then 50%:

    IF summation[x](close > sma[50]) >= (x/2) THEN

    For at least one within “x” periods:

    IF summation[x](close > sma[50]) THEN
    guitarrocker thanked this post
    #93139 quote
    guitarrockerguitarrocker
    Participant
    Average

    Thank you @robertogozzi

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

Close of last x candels above sma


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

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