lignes horizontales mobiles
Forums › ProRealTime forum Français › Support ProBuilder › lignes horizontales mobiles
- This topic has 15 replies, 4 voices, and was last updated 7 years ago by Nicolas.
-
-
07/30/2017 at 9:34 AM #41994
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.
07/30/2017 at 10:07 AM #41995Je n’ai pas testé mais ce petit programme devrait faire l’affaire :
123456defparam drawonlastbaronly=truedrawhline(close+10*pointsize)drawhline(close-10*pointsize)RETURNEn temps réel, les lignes bougeront donc à chaque tick reçu.
07/30/2017 at 12:56 PM #42011Sorry 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:
12345678Defparam CalculateOnLastBars=1Defparam DrawOnLastBarOnly=trueSpread=2.5drawhline( close+Spread+10 )drawhline( close-Spread-10 )RETURNAnd 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.
1 user thanked author for this post.
07/30/2017 at 1:52 PM #42014That’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
1 user thanked author for this post.
07/30/2017 at 3:12 PM #42018I 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.
07/30/2017 at 5:30 PM #42021You 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 😀
1 user thanked author for this post.
07/30/2017 at 6:12 PM #42023Je 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 😉 ).
1 user thanked author for this post.
07/30/2017 at 7:34 PM #42028Huh ! 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 😉)
1 user thanked author for this post.
07/31/2017 at 9:20 AM #4205607/31/2017 at 9:25 AM #4205707/31/2017 at 9:40 AM #4205907/31/2017 at 9:41 AM #4206007/31/2017 at 9:48 AM #4206107/31/2017 at 9:52 AM #42062Voilà qui devrait fonctionner aussi sur les paires forex (le code qu’a gentiment fait AVT ne considérant pas les décimales):
1234567891011Defparam CalculateOnLastBars=1Defparam DrawOnLastBarOnly=trueSpread=2.5spr = (spread/2)*pointsizedrawhline( close+spr+10*pointsize)drawhline( close-spr-10*pointsize)RETURNIl 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).
1 user thanked author for this post.
07/31/2017 at 9:54 AM #42064 -
AuthorPosts
Find exclusive trading pro-tools on