appel fonction repeté

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #45228 quote
    NicoNico
    Participant
    Average

    Bonjour

    J’ai crée un petit systeme auto avec  l’assistant voici le code qui est généré.

    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Conditions to enter long positions
    indicator1 = Average[20](close)
    c1 = (close >= indicator1)
    
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator2 = Average[20](close)
    c2 = (close <= indicator2)
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    

    La question est pourquoi repete t’il l’appel de la moyenne (indicator2 = Average[20](close)) et n’utilise t’il pas le 1er appel ?

    Je suppose que le code est executé a chaque tick, donc la valeur d’indicator1 est bonne pour tester la sortie.

    Merci

    #45405 quote
    NicolasNicolas
    Keymaster
    Legend

    C’est vrai, mais c’est ainsi que fonctionne la création assistée. Dans le cas de ton code ci-dessus, la variable “indicator2” est inutile puisque le programme connaît déjà la valeur de la moyenne mobile 20 périodes contenu dans la variable “indicator1” déclarée à la ligne 4.

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

appel fonction repeté


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Nico @nico Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
9 years, 1 month ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 09/02/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...