Aide Programmation de code "Cross Value"

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #135722 quote
    Fantasio2020
    Participant
    Senior

    Bonjour la communauté,

    quelqu’un pourrait m’aider sur la syntaxe correct d’un code?

    x = 10
    
    If (Close > close[1])[x] Then
    Bull = +1
    Bear = 0
    Elsif (Close < Close[1])[x] Then
    Bull = 0
    Bear = -1
    else
    Bull = 0
    Bear = 0
    Endif
    
    Return Bull, Bear

    je cherche à avoir:

    • (Close>Close[1]) sur les [x] dernières périodes
    • (Close<Close[1]) sur les [x] dernières périodes

    Je suis pas du tout convaincu que la syntaxe soit correct!

    merci pour l’aide.

    #135728 quote
    Nicolas
    Keymaster
    Master

    Faire une somme des conditions booléennes, soit pour la hausse:

    hausse = summation[x](Close>Close[1])
    Fantasio2020 thanked this post
    #135749 quote
    Fantasio2020
    Participant
    Senior

    Slt Nicolas,

    Il n’y a pas une alternative à Summation, avec une boucle conditionnelle WHILE?

    Slts

    #135953 quote
    Nicolas
    Keymaster
    Master

    Oui, tu peux remplacer SUMMATION par une boucle en effet, dans le cas présent je ne vois pas l’intérêt, mais tous les chemins mènent à Rome ! 😉

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Aide Programmation de code "Cross Value"


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

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

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 06/12/2020
Status: Active
Attachments: No files
Logo Logo
Loading...