Transformer un Back test en indicateur

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

    Bonjour,

     

    Je voudrais utiliser des back tests pour créer un indicateur qui me donne une zone durant laquelle je peux acheter ou vendre. Le Stop loss et le take profit du back test vont servir pour définir à range à trader.

    Le problème c’est qu’une fois le TP ou le SL atteint ce que j’ai bricolé redonne un signal quand le prix réintègre la zone du range. Je voudrais qu’il ne donne plus le signal jusqu’au prochain croisement des 2 SMA qui redonnera un nouveau signal et un nouveau range.

    Je ne trouve pas le code insert PRT code, j’ai mis le fichier ITF en PJ

    Capture-decran-744.jpg Capture-decran-744.jpg TestBTindicateur.itf
    #240081 quote
    Bodaris
    Participant
    New

    Voilà, j’ai retrouvé la touche pour insérer le code :p

    
    // Code principal : $BT/NSD100/M20/M100/H4(TS)
    //-------------------------------------------------------------------------
    // Définition des paramètres du code
    DEFPARAM CumulateOrders = true // Cumul des positions désactivé
    
    timeframe(4 hours, UPDATEONCLOSE )
    i=Average[20](close)
    ii=Average[100](close)
    
    mymm200=Average[200](close)
    MYSUP1=Supertrend[1.5,10]
    
    
    
    if i crosses under ii then
    llbar=barindex
    j=j+1
    dir=1
    endif
    
    if i < ii then
    llperiod=max(1,barindex-llbar)
    $llbar[j]=barindex[lowestBars[llperiod]]
    $ll[j]=lowest[llperiod](low)
    $dir[j]=-1
    LL = $ll[j]
    elsif i crosses over ii THEN
    $plusbas[1] = LL
    endif
    
    // Conditions pour ouvrir une position acheteuse en H4
    
    vos=i crosses over ii and close>mymm200
    
    if vos  then
    $sl[1]=$plusbas[1]
    $achat[1]=close
    diff= close-$sl[1]
    $tp[1]=close+diff
    achat=1
    ELSE
    achat =0
    
    ENDIF
    
    if $achat[1]+diff >close THEN
    hausse=0
    ELSE
    hausse =1
    ENDIF
    
    if $achat[1]-diff<close THEN
    baisse=-1
    ELSE
    baisse=0
    ENDIF
    
    if close<$tp[1] and close>$plusbas[1]  THEN
    achete=1
    ELSE
    achete=0
    ENDIF
    
    GRAPHONPRICE  $plusbas[1]
    GRAPHONPRICE $tp[1]
    
    graph achete 
    
    timeframe(default)
    
    if achete then 
    buy AT MARKET 
    ENDIF 
    
    set target pprofit 5
    Iván González thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Transformer un Back test en indicateur


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Bodaris @bodaris Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by Bodaris
1 year, 3 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 11/07/2024
Status: Active
Attachments: 2 files
Logo Logo
Loading...