Equal to highest percentage change in 2 days

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #41359 quote
    mykologenmykologen
    Participant
    Average

    Hello

    Issue with percentage change. The idea is following:

    “The precentage change today should be equal to the highest percenage change in 2 days. Measured close to close.”

    I am trying to use the simplified creation as far as I can and then supplement the strategy manually in the end. With Variation I have added following (c7):

    // Conditions to enter short positions
    c4 = (close[1] > close[2])
    c5 = (close > close[1])
    indicator4 = Average[200](close)
    c6 = (close < indicator4)
    indicator5 = Variation(close)
    c7 = (indicator5 = indicator5[2])

    So question is how do I rewrite the code so its equal to the highest percenage change in 2 days (close to close)?
    As it is right now, checks only 2 days ago. Maybe its even possible to do it with simplified creation?

    #41968 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    if your 2 days variations are “yesterday to today” and “day before yesterday to yesterday” then you’d want:
    c7 = indicator5>=indicator5[1]

    #42347 quote
    mykologenmykologen
    Participant
    Average

    Thanks for your answer.

    Would I be able to write the code like this:

    c9 = variation(close) >= (variation(close[1]) and variation(close[2]))

    So, variation today is equal or higher than (the variation yesterday and the day before yesterday)?

    #42393 quote
    NicolasNicolas
    Keymaster
    Legend

    No, you need to type 2 times the condition:

    c9 = (variation(close) >= variation(close[1])) AND (variation(close) >= variation(close[2]))
    mykologen thanked this post
    #42416 quote
    mykologenmykologen
    Participant
    Average

    Thanks and appologies for my “beginner” questions… 🙂

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

Equal to highest percentage change in 2 days


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
mykologen @mykologen Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by mykologenmykologen
9 years, 1 month ago.

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