strategie bulle Bollinger

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #229406 quote
    gtfgtf
    Participant
    New

    Bonjour,

     

    Je souhaite transformer ce code suivant de tradingview en prorealtime  : rentrer en achat lorsque le cours est en dehors des Bollinger acec un stop sous le 5 dernier plus bas et objectif sur le 20 dernier plus haut

    f open[1] < lwr[1] and close[1] < lwr[1] // Previous price lower than lower band and current close is higher than lower band
    stop_level=lowest(5)
    profit_level=highest(20)
    strategy.entry(id=’bb_buy’,long=true)
    strategy.exit(“TP/SL”,”bb_buy”,stop=stop_level,limit=profit_level)
    if open[1] > upr[1] and close[1] > upr // Previous price is higher than higher band & current close is lower the higher band
    stop_level=highest(5)
    profit_level=lowest(20)
    strategy.entry(id=’bb_sell’,long=false)
    strategy.exit(“TP/SL”,”bb_sell”,stop=stop_level,limit=profit_level)
    #229438 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Bonjour Il n'y a pas de cohérence entre ce que dit le code et l'explication… Je vais vous donner un exemple : f open[1] < lwr[1] and close[1] < lwr[1] // Previous price lower than lower band and current close is higher than lower band Dans ce cas, le code dit que vous devez remplir deux conditions simultanément : 1.- l'ouverture de la barre précédente en dessous de la bande inférieure de Bollinger (je suppose que lwr fait référence à Bollinger car le code n'est pas complet soit que vous facilitiez) 2.- fermez la barre précédente en dessous de la bande de Bollinger inférieure. Cela n'est pas cohérent avec l'explication selon laquelle « la clôture actuelle est supérieure à la bande inférieure ». La question est donc la suivante. Voulez-vous la traduction littérale du code que vous avez fourni ou ce qu'il y a dans l'explication… ?

    #229440 quote
    gtfgtf
    Participant
    New

    Bonjour,

     

    Merci pour la prise en compte de ma demande.

    Je n arrive pas a coder la stratégie suivante : lorsque le prix sort en dehors des bandes de bollinger basse ou haute ( une bulle ) je passe en position avec un stop sur le 5 derniers plus bas avec comme objectif le 5 dernier plus haut .

     

    Muchas gracias para la ayuda

    #229441 quote
    gtfgtf
    Participant
    New

    Bonjour,

     

    Un complement j ouvre une position lorsque le cours apres une bulle reintégre la bande de bollinger avec un bas plus haut que le précedent et un haut plus haut que le precedent

    #229447 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Ici c'est

    upr = bollingerup[20](close)
    lwr = BollingerDown[20](close)
    
    ///setup long
    b1 = close[1]<lwr[1] // if you want all candle below the line write high[1]<lwr[1]
    b2 = close>lwr // if you want all candle above the line write low > lwr
    b3 = high>high[1]
    b4 = low>low[1]
    setuplong = b1 and b2 and b3 and b4
    
    if not onmarket and setuplong  then
    buy 1 shares at market
    set stop price lowest[5](low)
    set target price highest[20](high)
    endif
    
    //setup short
    sh1 = close[1]>upr[1]// if you want all candle above the line write low[1]>upr[1]
    sh2 = close<lwr// if you want all candle below the line write high < lwr
    sh3 = low<low[1]
    sh4 = high<high[1]
    
    setupshort = sh1 and sh2 and sh3 and sh4
    
    if not onmarket and  setupshort then
    sell 1 shares at market
    set stop price highest[5](high)
    set target price lowest[20](low)
    endif
    #229460 quote
    gtfgtf
    Participant
    New

    je teste tout a l’heure Gracias

    #229493 quote
    gtfgtf
    Participant
    New

    est il possible d avoir pour entrer position un prix qui a le plus et le plus haut en dehors de la Bollinger ? avec un take profit mm7

    #229510 quote
    gtfgtf
    Participant
    New

    j ai modifie cela fonctionne uniquement sur des positions longues

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions désactivé

    upr = bollingerup[20](close)
    lwr = BollingerDown[20](close)

    ///setup long

    b1 = close[1]<lwr[1] // if you want all candle below the line write high[1]<lwr[1]
    b5=high[1]<lwr[1]
    b2 = close>lwr // if you want all candle above the line write low > lwr
    b3 = high>high[1]
    b4 = low>low[1]
    setuplong = b1 and b2 and b3 and b4 and b5

    if not onmarket and setuplong then
    buy 1 shares at market
    set stop price lowest[20](low)
    set target price highest[20](high)
    endif

    //setup short
    sh5= low[1]>upr[1]
    sh1 = close[1]>upr[1]// if you want all candle above the line write low[1]>upr[1]
    sh2 = close<lwr// if you want all candle below the line write high < lwr
    sh3 = low<low[1]
    sh4 = high<high[1]

    setupshort = sh1 and sh2 and sh3 and sh4 and sh5

    if not onmarket and setupshort then
    sell 1 shares at market
    set stop price highest[20](high)
    set target price lowest[20](low)
    endif

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

strategie bulle Bollinger


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
gtf @gtf Participant
Summary

This topic contains 7 replies,
has 2 voices, and was last updated by gtfgtf
2 years, 6 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 03/07/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...