Programmation stratégie bougies Renko

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #220154 quote
    DakotaDakota
    Participant
    New

    Bonjour j’ai tenté de coder une stratégie sur les bougies Renko (avec l’aide de ChatGPT) mais j’ai des erreurs de syntaxe de partout et je ne sais pas pourquoi.

    Voici le code :

    //@version=4
    strategy(“Stratégie Renko + Moyenne Mobile + Double Creux”, shorttitle=”Renko+MA”, overlay=true)

    // Paramètres de la bougie Renko
    boxSize = input(20, title=”Taille de la bougie Renko”)
    renkoClose = close[1] + boxSize * (close/open > 1 ? 1 : close/open < 1 ? -1 : 0)
    renkoLow = low[1] + boxSize * (low/open > 1 ? 1 : low/open < 1 ? -1 : 0)

    // Calcul de la moyenne mobile
    sma50 = sma(close, 50)

    // Conditions d’achat
    doubleBottomCondition = renkoLow[2] > renkoLow[4] and renkoLow[3] > renkoLow[4] and renkoLow[2] < renkoLow[1] and renkoLow[3] < renkoLow[1]
    aboveMaCondition = renkoClose > sma50

    buyCondition = doubleBottomCondition and aboveMaCondition

    // Tracé des bougies Renko
    plot(renkoClose, color=color.green, style=plot.style_columns, title=”Renko Close”)
    plot(renkoLow, color=color.red, style=plot.style_columns, title=”Renko Low”)

    // Tracé de la moyenne mobile
    plot(sma50, color=color.orange, title=”Moyenne Mobile 50″)

    // Marquage du signal d’achat
    plotshape(buyCondition, location=location.belowbar, color=color.green, style=shape.triangleup, title=”Signal d’Achat”)

    // Gestion de la position
    if (buyCondition)
    strategy.entry(“Achat”, strategy.long)

    // Sortie de position (Stop loss et Take profit)
    stopLossPrice = renkoLow[1] // Stop loss au niveau du creux le plus bas
    takeProfitPrice = renkoClose + 2 * (renkoClose – stopLossPrice) // Take profit à 2 fois le stop loss
    strategy.exit(“Take Profit/Stop Loss”, from_entry=”Achat”, stop=stopLossPrice, limit=takeProfitPrice)

    ////////

    Pouvez-vous me dire où ça coince (PRT me met du rouge à chaque terme qui se trouve entre guillemets déjà) ?

    Merci

    #220169 quote
    NicolasNicolas
    Keymaster
    Legend

    Il s’agit d’un code non compatible avec PRT, il utilise un mix de langage entre le pinescript et le probuilder..

    En fait, ça coince à chaque ligne ! 🙁

    Si tu n’as pas encore essayé, tu devrais tenter une approche avec le prompt que j’ai partagé dans le sujet dédié sur ChatGPT ici: Create strategies codes with ChatGPT for ProRealTime

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

Programmation stratégie bougies Renko


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Dakota @dakota Participant
Summary

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

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 08/31/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...