lignes horizontales mobiles

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #41994 quote
    Ramahu
    Participant
    Senior

    Bonjour à tous, j’aimerai savoir si l’indicateur que je vais décrire existe ou si vous pouvez m’apporter votre aide 🙂

    J’aimerai 2 lignes horizontales qui se déplacent en même temps que le cours (BID), l’indicateur ne serait pas figé dans le temps à aucun moment, juste que ces 2 lignes se positionnent à +10 et -10P du prix constamment,

    peut importe l’UT, merci.

    #41995 quote
    Nicolas
    Keymaster
    Master

    Je n’ai pas testé mais ce petit programme devrait faire l’affaire :

    defparam drawonlastbaronly=true
    
    drawhline(close+10*pointsize)
    drawhline(close-10*pointsize)
    
    RETURN

    En temps réel, les lignes bougeront donc à chaque tick reçu.

    #42011 quote
    AVT
    Participant
    Senior

    Sorry Nicolas, but is it really so simple?

    The bid price (always forget whether that is buy or sell) – anyways that one adds/deducts the spread.

    Example DAX (weekend, so nearly nothing happens in Tick-by-Tick): close=12.179,7 buy=12.182,2 sell=12.177,2 as shown in my order interface, spread=2,5. This means I first have to add/deduct the spread to get my long/short prices and then add/deduct the 10 points. So my code would be this:

    Defparam CalculateOnLastBars=1
    Defparam DrawOnLastBarOnly=true
    
    Spread=2.5
    drawhline( close+Spread+10 )
    drawhline( close-Spread-10 )
    
    RETURN

    And this is for an index which uses a fixed spread. If I open MT4 (MT4 can show bid and ask line) and load some Forex with another broker than IG, the spread is constantly changing, depending on the volatility – which would be uncodable as far as I see.

    Just my thoughts on that matter.

    Pepsmile thanked this post
    #42014 quote
    Pepsmile
    Participant
    Veteran

    That’s right AVT the spread lines could only be considered as an average estimation on PRT.

    But on my opinion I would write spread as :       Spread=2.5/2

    to add only half of the spread to each side

    AVT thanked this post
    #42018 quote
    AVT
    Participant
    Senior

    @Pepsmile

    I was a bit unclear in calling that 2.5 Spread. The whole Spread is 5, so I already did the 5/2 to get the value to be calculated first. But to name that as Spread is missleading, if not to say simply incorrect. Thanks for pointing this out.

    #42021 quote
    Nicolas
    Keymaster
    Master

    You are right but since there is no automatic way to retrieve the current instrument spread, I opted for the most simple code to answer to this query…and because we are in a French topic, please use Google translate.. Or learn French 😀

    AVT thanked this post
    #42023 quote
    AVT
    Participant
    Senior

    Je suis désolé que je n’écrivais pas en Français. J’espère que vous me pardonnerez à l’avenir si mes accents ne sont pas parfait. En langues étrangères je peux parler mieux que écrire (et plus rapide 😉 ).

    Nicolas thanked this post
    #42028 quote
    Pepsmile
    Participant
    Veteran

    Huh !  that’s why I thought that anglophones paid only half spread than francophones ! 😉

    (en français, et à peu près… : il me semblait que les anglophones payaient la moitié de notre spread seulement 😉)

    AVT thanked this post
    #42056 quote
    Ramahu
    Participant
    Senior

    Bonjour Nicolas, merci, je n’ai pas eu de notif de ta reponse, par contre impossible de tester, il y a une erreur sur le ligne 1 sur l’assignation “drawoblastbaronly”

    #42057 quote
    Ramahu
    Participant
    Senior

    Apparement le 2nd code de AVT est pris par la plateforme, impossible de determiner s’il est ok pour le moment puisque PRT à un soucis (IG) ce matin je vous tiens au courant merci à vous.

    #42059 quote
    Ramahu
    Participant
    Senior

    Ok donc ca fonctionne sur le DAX, mais pas sur le FX (cest ce que je veux bien sur ^^) et meme sur DAX avec regles 10-10 le slignes bougent à environ 11-12P :/ une solution ?

    #42060 quote
    Nicolas
    Keymaster
    Master

    Effectivement, j’ai fait une erreur de typo, il faut lire:

    drawonlastbaronly=true

    désolé 😐

    #42061 quote
    Ramahu
    Participant
    Senior

    😀 ca fonctionne parfaitement grand merci. Je voulais savoir s’il etait possible pour quelqu’un de le “transformer” pour MT4 ou j’en demande trop ? ^^

    #42062 quote
    Nicolas
    Keymaster
    Master

    Voilà qui devrait fonctionner aussi sur les paires forex (le code qu’a gentiment fait AVT ne considérant pas les décimales):

    Defparam CalculateOnLastBars=1
    Defparam DrawOnLastBarOnly=true
    
    Spread=2.5
    
    spr = (spread/2)*pointsize
    
    drawhline( close+spr+10*pointsize) 
    drawhline( close-spr-10*pointsize) 
    
    RETURN

    Il faudra renseigner soit même le spread courant à la ligne 4 du code (à adapter bien entendu suivant la parité forex en cours sur le graphique).

    AVT thanked this post
    line-breakout-forex-trading.png line-breakout-forex-trading.png
    #42064 quote
    Ramahu
    Participant
    Senior

    Pas besoin de renseigner le spread en fait cela fonctionne avec votre premier code, maintenant je cherche une solution pour MT4 :).

    Les lignes collent parfaitement au bid cest l’essentiel

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

lignes horizontales mobiles


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Ramahu @ramahu Participant
Summary

This topic contains 15 replies,
has 4 voices, and was last updated by Nicolas
8 years, 7 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/30/2017
Status: Active
Attachments: 1 files
Logo Logo
Loading...