Stratégie avec indicateur ASCTREND

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #159207 quote
    Fab28
    Participant
    Senior

    Bonjour

    Je souhaiterai insérer et optimiser l’indicateur ASCTREND dans une stratégie

    ASCTrend

    Comment supprimer les flèches qui sont à la fin du code et les remplacer par une variable que déterminerait une condition d’achat ou de vente ?

    (ligne 9 et 23)

    Voici la fin du code :

    if ($Tablevalue2[shift+i1]>x1) then
    value3=High[shift]+iRange*0.5
    if (shift = 1 and flagval1=0) then
    flagval1=1
    flagval2=0
    endif
    $val1[shift]=value3
    drawarrowdown(barindex[shift],$val1[shift]) coloured(255,0,255)
    endif
    
    if (value2>x1) then
    i1=1
    while ($Tablevalue2[shift+i1]>=x2 and $Tablevalue2[shift+i1]<=x1) do
    i1=i1+1
    wend
    if ($Tablevalue2[shift+i1]<x2) then
    value3=Low[shift]-iRange*0.5
    if (shift = 1 and flagval2=0) then
    flagval2=1
    flagval1=0
    endif
    $val2[shift]=value3
    drawarrowup(barindex[shift],$val2[shift]) coloured(0,255,255)
    endif
    
    shift=shift-1
    wend
    endif
    
    
    
    #159213 quote
    fifi743
    Participant
    Master

    bonjour,

    tu enlève drawarrowup ou drawarrowdown et tu remplace par ta variable ,mais ça marche a condition que le signal n’est pas trop de retard.

    #159217 quote
    Fab28
    Participant
    Senior
    A1 = (barindex[shift],$val2[shift]) coloured(0,255,255)

    Ca ne fonctionne pas.

    J’ai une erreur si je fais ça

    idem pour cette ligne

    A1  =  drawarrowup(barindex[shift],$val2[shift])
    #159221 quote
    fifi743
    Participant
    Master
     ASCTrend
    if ($Tablevalue2[shift+i1]>x1) then
    value3=High[shift]+iRange*0.5
    if (shift = 1 and flagval1=0) then
    flagval1=1
    flagval2=0
    endif
    $val1[shift]=value3
    drawarrowdown(barindex[shift],$val1[shift]) coloured(255,0,255)
    endif
    
    if (value2>x1) then
    i1=1
    while ($Tablevalue2[shift+i1]>=x2 and $Tablevalue2[shift+i1]<=x1) do
    i1=i1+1
    wend
    if ($Tablevalue2[shift+i1]<x2) then
    value3=Low[shift]-iRange*0.5
    if (shift = 1 and flagval2=0) then
    flagval2=1
    flagval1=0
    endif
    $val2[shift]=value3
    drawarrowup(barindex[shift],$val2[shift]) coloured(0,255,255)
    endif
    
    shift=shift-1
    wend
    endif
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    	
    if ($Tablevalue2[shift+i1]>x1) then
    value3=High[shift]+iRange*0.5
    if (shift = 1 and flagval1=0) then
    flagval1=1
    flagval2=0
    endif
    $val1[shift]=value3
    sellshort 1 contract at market
    endif
     
    if (value2>x1) then
    i1=1
    while ($Tablevalue2[shift+i1]>=x2 and $Tablevalue2[shift+i1]<=x1) do
    i1=i1+1
    wend
    if ($Tablevalue2[shift+i1]<x2) then
    value3=Low[shift]-iRange*0.5
    if (shift = 1 and flagval2=0) then
    flagval2=1
    flagval1=0
    endif
    $val2[shift]=value3
    BUY 1 contract at market
    endif
     
    shift=shift-1
    wend
    endif

    et comme ça ,mais attention au retard du signal

    #159612 quote
    Fab28
    Participant
    Senior

    Ca ne fonctionne toujours pas.
    En intégrant C1 = C1 +1 et C2= C2-1 (voir ligne 29 et 13)
    C1 et C2 restent à 0

    if (value2<x2) then
    i1=1
    while ($Tablevalue2[shift+i1]>=x2 and $Tablevalue2[shift+i1]<=x1) do
    i1=i1+1
    wend
    if ($Tablevalue2[shift+i1]>x1) then
    value3=High[shift]+iRange*0.5
    if (shift = 1 and flagval1=0) then
    flagval1=1
    flagval2=0
    endif
    $val1[shift]=value3
    C1 = C1 +1
    endif
    endif
    
    if (value2>x1) then
    i1=1
    while ($Tablevalue2[shift+i1]>=x2 and $Tablevalue2[shift+i1]<=x1) do
    i1=i1+1
    wend
    if ($Tablevalue2[shift+i1]<x2) then
    value3=Low[shift]-iRange*0.5
    if (shift = 1 and flagval2=0) then
    flagval2=1
    flagval1=0
    endif
    $val2[shift]=value3
    C2 = C2 -1
    endif
    endif
    
    
    shift=shift-1
    wend
    endif
    return C1, C2
    #159634 quote
    Nicolas
    Keymaster
    Master

    Le fichier itf ci-joint comporte la stratégie et une inversion modifiée de l’indicateur permettant la prise des signaux de trading avec l’indicateur ASCtrend.

    Fab28 thanked this post
    #160193 quote
    Lavallette
    Participant
    Average

    Merci Nicolas, cet indicateur semble intéressant. Mais ne repeint-il pas. On voit que la barre s’affiche et disparait et parfois s’affiche à nouveau.

    Je parle de la dernière barre .

    Est-ce normal?

    #160199 quote
    Nicolas
    Keymaster
    Master

    C’est la même chose pour tous les indicateurs basés sur le Close, tant que la bougie n’est pas terminé, l’information peut changer. Par ailleurs, ce n’est pas ce qu’on appelle “repeindre”, ce terme est communément utilisé pour désigner une information du passé qui change pour paraître beaucoup plus juste quand on connaît ce qui va se passer ensuite.

    #160215 quote
    Lavallette
    Participant
    Average

    En effet le terme n’est pas repeindre, mais je ne sais pas comment comment cela s’appelle, c’est pourquoi j’avais précisé dernière barre. 🙂

    Je vais faire des tests en automatique, mais je me demande si je ne risque pas d’avoir des positions qui sont déclenchées “pendant” la bougie, mais qui en fin de bougie ne seront pas confirmées.

     

    Je ne m’étais jamais posé la question, mais je ne sais pas si c’est nouveau ou simplement que je n’avais jamais remarqué. Question/problème de Newbie sûrement.

    Un grand merci en tous les cas.

     

    #160221 quote
    Nicolas
    Keymaster
    Master

    Sous ProBacktest, le code est lu une seule fois à la fermeture de la bougie, donc les informations ne bougeront plus et le signal ne changera plus.

    Lavallette thanked this post
    #160234 quote
    Lavallette
    Participant
    Average

    En effet je viens de le constater. C’est top.

    Merci pour votre aide.

    #175052 quote
    murre87
    Participant
    Senior

    Have you found a suitable market and TF for this indicator?

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

Stratégie avec indicateur ASCTREND


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Fab28 @fab28 Participant
Summary

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

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 01/24/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...