Aide pour coder la stratégie volume waves oscillator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #59531 quote
    Sonia
    Participant
    Average

    Bonjour,

    Voilà j’essaye de coder une stratégie et çà marche pas, ou plutôt si çà marche trop bien !!

    Je souhaite prendre un ordre une seule fois, quand les volumes passent au dessus de 0 “achat” et inverser la position quand les volumes passent en dessous de 0 “vente”.

    Avec le code ci-dessous, j’ai une entrée à chaque barre de l’histogramme. Merci pour votre aide.

     

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    
    // Conditions pour ouvrir une position acheteuse
    indicator1, indicator2 = CALL "*Volume waves oscillator"
    c1 = (indicator1 CROSSES UNDER indicator2)
    
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position acheteuse
    indicator3, indicator4 = CALL "*Volume waves oscillator"
    c2 = (indicator3 CROSSES OVER indicator4)
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    indicator5, indicator6 = CALL "*Volume waves oscillator"
    c3 = (indicator5 CROSSES OVER indicator6)
    
    IF c3 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position en vente à découvert
    indicator7, indicator8 = CALL "*Volume waves oscillator"
    c4 = (indicator7 CROSSES UNDER indicator8)
    
    IF c4 THEN
    EXITSHORT AT MARKET
    ENDIF
    #59630 quote
    Nicolas
    Keymaster
    Master

    J’ai créé la stratégie en utilisant directement le code de l’indicateur en question (volumes waves oscillator) , voici le code:

    DEFPARAM CumulateOrders = False
    
    Onda = Weightedaverage [150] (close)
    Wave= ((close/Onda)-1)*100
    
    if wave crosses over 0 then 
    buy 1 contract at market 
    endif 
    
    if wave crosses under 0 then 
    sellshort 1 contract at market 
    endif
    #59633 quote
    Sonia
    Participant
    Average

    Merci Nicolas

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

Aide pour coder la stratégie volume waves oscillator


Support ProOrder

New Reply
Author
author-avatar
Sonia @sonia Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Sonia
8 years ago.

Topic Details
Forum: Support ProOrder
Language: French
Started: 01/15/2018
Status: Active
Attachments: No files
Logo Logo
Loading...