Connaître le nombre de chandelier sous 0€

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #140723 quote
    Nicolas
    Keymaster
    Master

    Si tu veux connaître la quantité de chandeliers en M15, déplace donc les lignes 18 à 28 dans ce timeframe (sous la ligne 10), cela t’évitera des calculs hasardeux pour la conversion M1 vers M15.

    #140725 quote
    imencity
    Participant
    Senior

    C’est le contraire.

    Je veux connaître le nombre de chandelier en M1 depuis un achat ou vente fait en M15.
    Ainsi en fonction du nombre de chandelier et de la perte, je pourrais choisir de couper. L’intérêt de passer par du M1 est de pouvoir couper plus finement les pertes, sur une stratégie en M15.
    Enfin je le vois comme ça mais je me trompe peut-être.

    Comment puis-he faire stp ? Car j’ai bien compris que le barindex n’était pas le même…

    #140752 quote
    imencity
    Participant
    Senior

    Et j’ai tenté de faire:

    achat = 1

    dans le TF M15 au moment de l’achat pour faire dans le TF M1:

    timeframe(1 minutes)
    IF achat = 1 THEN
    start = barindex
    achat = 0
    ENDIF

    Mais j’ai le message d’erreur qui me dit qu’une variable ne peut être assigné à différent TF… 🙁

    #140760 quote
    Nicolas
    Keymaster
    Master

    Essayons comme ceci :

    defparam cumulateorders=false
    
    timeframe(15 minutes)
    
    //strategy example
    if not onmarket and rsi[14] crosses over 50 then
    buy at market
    start = barindex
    set stop %loss 2.5
    endif
    
    
    timeframe(1 minutes)
    if rsi[14] crosses under 50 then
    sell at market
    endif
    
    //how many bars were in profit
    if onmarket then
    if not onmarket[1] then 
     start1=barindex
    endif
    //floating profit
    floatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize
    if floatingprofit>0 and lastorder<start then
    lastorder=start
    bar=barindex-start1
    endif
    else
    bar=0
    endif
    
    graph bar
    #140767 quote
    imencity
    Participant
    Senior

    J’ai le même problème avec des graph bar de 85500… au lieu de 3 par ex.

    TFbarre.jpg TFbarre.jpg
    #140769 quote
    imencity
    Participant
    Senior

    J’ai d’ailleurs du mal à comprendre comment lastorder peut fonctionner alors qu’il est initialiser après la condition ? La première fois, non initialisé le rend égale à zéro j’imagine ?

    #140878 quote
    imencity
    Participant
    Senior

    Nicolas,

    A ton avis, qu’est-qui cloche dans le code que tu a donné pour que ça ne fonctionne pas stp ?

    #140879 quote
    imencity
    Participant
    Senior

    Si je commente les TF évidemment ça fonctionne.

    #140967 quote
    imencity
    Participant
    Senior

    Personne n’a une idée svp ?

Viewing 9 posts - 16 through 24 (of 24 total)
  • You must be logged in to reply to this topic.

Connaître le nombre de chandelier sous 0€


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
imencity @imencity Participant
Summary

This topic contains 23 replies,
has 2 voices, and was last updated by imencity
5 years, 7 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 07/22/2020
Status: Active
Attachments: 4 files
Logo Logo
Loading...