Current price greater than Previous Price by 5%

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #130508 quote
    InnertradeInnertrade
    Participant
    New

    I’m playing with the backtest feature – it’s pretty awesome, but I’m not from a programming background and the Simplified creation doesn’t enable me to do the below.

    Basically I want to the current price to have increased by 5% of the price 10 candles before. Can anyone help?

    Current price > Previous price x 1.05

    Would it go something like this?: c1 = (close[1] > close[10]*1.05)

    I hope that make sense. Thank you!

    #130510 quote
    VonasiVonasi
    Moderator
    Master
     c1 = (close[1] > close[10]*1.05)

    Would be the close of the previous candle is greater than the close of the candle 9 candles before that. The current candle is candle zero so you you need:

     c1 = (close[0] > close[9]*1.05)

     

    If you don’t place any [ ] after close then if defaults to the current candle so you can also just use:

    c1 = (close > close[9]*1.05)
    Innertrade thanked this post
    #130513 quote
    InnertradeInnertrade
    Participant
    New

    I’m going to have to try and learn this coding, seems fun.

    And that worked perfectly, many thanks.

    #130517 quote
    VonasiVonasi
    Moderator
    Master

    You can find descriptions of every instruction and examples of how to use them here (or by clicking on help and going to the documentation):

    https://www.prorealcode.com/prorealtime-documentation/

    Innertrade thanked this post
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

Current price greater than Previous Price by 5%


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Innertrade @innertrade Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by VonasiVonasi
6 years, 4 months ago.

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