Erreur lors du codage “Fin du code Null”

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

    Bonjour, je demande votre aide car j’ai quelques petits soucis de codage avec proOrder

    Alors que tout semble etre bien codé, lorsque je tente d’effectuer un backtest ou bien de lancer le systeme en temps réel, j’ai ce message d’erreur qui s’affiche.
    Pourriez-vous m’aider car je ne parviens a deteceter mon erreur et surtout Pro Order prend en compte une ligne de code inexistante.

    Merci à celui qui sera mon sauveur.

    J’ajoute le code ainsi qu’une capture d’écran du message d’erreur.

    DEFPARAM CumulateOrders = true
    DEFPARAM Preloadbars = 4000
    
    // TAILLE DES POSITIONS
    N = 1
    
    
    // POSITION LONGUE
    ca1 = RSI[21] crosses over 50
    ca2 = average[20] crosses over average[50]
    ca3 = average[50] crosses over average[20]
    CONDACHAT = ca1 and ca2
    
    IF CONDACHAT THEN
    Buy 1 CONTRACT at market
    SET STOP PLOSS 55
    SET TARGET PPROFIT 100
    ENDIF
    if RSI[21] crosses under 50 then
    sell 1 contract at market
    // POSITION COURTE
    cV1 = RSI[21] crosses under 50
    cv2 = average[20]crosses under average[50](close)
    cv3 = average[50](close) crosses under average[20]
    CONDVENTE = cv1 and cv2
    
    IF CONDVENTE then
    Sellshort 1 CONTRACT at market
    SET STOP PLOSS 55
    SET TARGET PPROFIT 100
    ENDIF
    if RSI[21] crosses over 50 then
    sell 1 contract at market
    Erreur-code-FOrex.png Erreur-code-FOrex.png
    #144773 quote
    robertogozzi
    Moderator
    Master

    Il manque deux ENDIF, un pour fermer la ligne 19 et un autre pour fermer la ligne 32.

    #144776 quote
    khroonos
    Participant
    New

    Bonjour,

    un grand merci à toi !!! Tout fonctionne parfaitement.
    Coup j’aurais une autre question, est-il possible de declencher un ordre d’achat lorsque qu’une bougie casse la moyenne mobile 50 à la hausse ? Si oui, de quelle manière puis-je inserer cette ligne dans mon code ?

    Merci d’avance

    #144812 quote
    Nicolas
    Keymaster
    Master
    if close crosses over average[50] then 
     buy at market 
    endif
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Erreur lors du codage “Fin du code Null”


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
khroonos @khroonos Participant
Summary

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

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 09/19/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...