PPO : existence de bug

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #137403 quote
    finplusfinplus
    Participant
    Master
    Defparam cumulateorders = False
    
    possize = 1
    SlowP = 26 //Periods of Slow Average
    FastP = 12 //Periods of Fast Average
    AvgType = 1 //Average Type (0=sma, 1=ema, 2=wma,…)
    Percentage = 1 //1=calculate Percentage 0=no percentage
    SignalP = 9 //Periods of Signal Average
    //
    SlowP = max(1,min(999,SlowP)) //1 – 999
    FastP = max(1,min(999,FastP)) //1 – 999
    AvgType = max(0,min(6,AvgType)) //0 – 6
    Percentage = max(0,min(1,Percentage)) //1=Percentage 0=NO Percentage
    SignalP = max(1,min(999,FastP)) //1 – 999
    SlowAvg = Average[SlowP,AvgType](close)
    FastAvg = Average[FastP,AvgType](close)
    ppo = FastAvg – SlowAvg
    IF Percentage THEN
    ppo = (ppo / SlowAvg) * 100
    ENDIF
    SignalLine = Average[SignalP,AvgType](ppo)
    Histo = Ppo – SignalLine
    
    If longonmarket and histo < 0 or ppo 0 or ppo > SignalLine Then
    Exitshort at market
    EndIf
    
    If ppo > 0 and signalLine SignalLine Then
    If shortonmarket Then
    Exitshort at market
    EndIf
    Buy possize contract at market
    ElsIf ppo 0 and ppo < SignalLine Then
    If longonmarket Then
    Sell at market
    EndIf
    Sellshort possize contract at market
    EndIf

    bonjour,

    j’ai récupéré le code ci-joint sur Prorealcode. Mais j’ai deux problèmes

    1. je pense que le code comporte des bugs (ex deux signalLine à la suite,  des “pop 0” sans signe entre les “ppo” et “0” en gras dans le code).
    2. J’ai essayé de corriger (j’ai supprimé un “signalLine”, j’ai mis (au pif” un signe “=” dans le premier ppo et un signe “<” dans le deuxième ppo. Et j’ai testé en back test : je me suis aperçu que le code ne permettait que des entrées “long” autrement dit ne fait qu’acheter”.

    Quelqu’un aurait il le code corrigé ? Merci d’avance.

    #137451 quote
    NicolasNicolas
    Keymaster
    Legend

    Où se trouve le code original sur le site stp ? Cela me permettrait de mieux comprendre le problème, merci.

    #137501 quote
    finplusfinplus
    Participant
    Master

    Percentage Price Oscillator (PPO)

     

     

    voilà j’ai retrouvé le lien.

    #137503 quote
    NicolasNicolas
    Keymaster
    Legend

    Je pense que c’est le  symbole < (inférieure) qui est à ajouter à ces endroits.

    #137785 quote
    finplusfinplus
    Participant
    Master

    Bonsoir,

    en oute, ligne 25 il est fait référence à un “exitshort” : or, à la ligne 24, il y a un “if longonmarket” donc ce serait plutôt un “sell” non ?

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

PPO : existence de bug


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
finplus @finplus Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by finplusfinplus
6 years, 5 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 06/28/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...