Heikin Ashi et Volume
Forums › ProRealTime forum Français › Support ProOrder › Heikin Ashi et Volume
- This topic has 7 replies, 2 voices, and was last updated 3 weeks ago by
robertogozzi.
-
-
03/01/2025 at 3:43 PM #244512
Bonjour à tous,
Je souhaite intégrer dans mon programme 2 éléments supplémentaires :
J’utilise Heikin Ashi et je voudrais que l’entrée en position se fasse lorsque la bougie clôture au dessus d’une SMA.
Et que les volumes soient supérieur à la SMA 7 mais qu’ils différencient les volumes haussiers ou baissiers. L’entrée en position acheteuse doit se faire uniquement si le volume est haussier et inversement.
Est ce que vous pourriez m’aider ?
Merci pour votre retour.
Bon week-end.
03/03/2025 at 3:52 PM #244588Le voilà :
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253defparam preloadbars = 0ONCE N = 7 //Periods// Bougies Heikin AshixOpen = openxClose = (open + close + high + low) / 4IF BarIndex > 0 THENxOpen = (xOpen[1] + xClose[1]) / 2ENDIF// Calculer la SMASma = average[N,0](xClose)// Calculer la SMA des volumesONCE SmaVolL = 0ONCE SmaVolS = 0ONCE maVolL = 0ONCE maVolS = 0Bullish = xClose > xOpenBearish = xClose < xOpenIF BarIndex > (N * 2) THENIF Bullish THENmaVolL = volumeSmaVolL = SmaVolL - maVolL[N] + maVolLELSIF Bearish THENmaVolS = volumeSmaVolS = SmaVolS - maVolS[N] + maVolSENDIFENDIFVolSmaL = SmaVolL / NVolSmaS = SmaVolS / N// Conditions d'entréeL1 = xClose > SmaS1 = xClose > SmaL2 = volume > VolSmaLS2 = volume > VolSmaSL3 = Not OnMarketS3 = Not OnMarketCondL = L1 AND L2 AND L3CondS = S1 AND S2 AND S3// Entrées sur le marchéIF CondL THENBUY 1 CONTRACT AT MARKETELSIF CondS THENSELLSHORT 1 CONTRACT AT MARKETENDIFSET STOP %LOSS 0.5SET TARGET %PROFIT 1////graph SmaVolL AS "SmaVolL" coloured("Blue")//graph maVolL AS "maVolL" coloured("Black")//graph VolSmaL AS "VolSmaL" coloured("Cyan"////graph SmaVolS AS "SmaVolS" coloured("Red")//graph maVolS AS "maVolS" coloured("Black")//graph VolSmaS AS "VolSmaS" coloured("Fuchsia")1 user thanked author for this post.
03/03/2025 at 5:46 PM #24459703/07/2025 at 6:16 PM #244754Bonjour,
J’ai essayé votre code mais cela ne fonctionne pas du tout…j’en suis désolé…
Je reviens donc vers vous pour essayer de corriger mon code.Ce qui ne fonctionne pas :
Il ne prend pas en compte les bougies Heikin Ashi mais les chandeliers Japonais,
Et il ne différencie pas les volumes haussiers ou baissiers.Pourriez vous faire les modifications dans le programme ci-dessous.
J’espère que vous pourrez m’aider.
Merci.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455// Définition des paramètres du codeDEFPARAM CumulateOrders = False // Cumul des positions désactivé// Annule tous les ordres en attente et ferme toutes les positions à 0:00, puis empêche toute création d'ordre avant l'heure "FLATBEFORE".DEFPARAM FLATBEFORE = 153000// Annule tous les ordres en attente et ferme toutes les positions à l'heure "FLATAFTER"DEFPARAM FLATAFTER = 220000// Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiésdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0// Conditions pour ouvrir une position acheteuseindicator1 = Average[5](high)c1 = (close >= indicator1)indicator2 = Volumeindicator3 = Average[20](indicator2)c2 = (indicator2 >= indicator3)indicator4, ignored, ignored, indicator5, ignored, ignored, ignored = CALL "TDI 2"(close)c3 = (indicator4 >= indicator5)indicator6, ignored, ignored, ignored, ignored, ignored, ignored = CALL "TDI 2"(close)c4 = (indicator6 >= 50)IF (c1 AND c2 AND c3 AND c4) AND not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIF// Conditions pour fermer une position acheteuseindicator7 = Average[5](low)c5 = (close <= indicator7)IF c5 THENSELL AT MARKETENDIF// Conditions pour ouvrir une position en vente à découvertindicator8 = Average[5](low)c6 = (close < indicator8)indicator9, ignored, ignored, indicator10, ignored, ignored, ignored = CALL "TDI 2"(close)c7 = (indicator9 <= indicator10)indicator11, ignored, ignored, ignored, ignored, ignored, ignored = CALL "TDI 2"(close)c8 = (indicator11 <= 50)indicator12 = Volumeindicator13 = Average[20](indicator12)c9 = (indicator12 >= indicator13)IF (c6 AND c7 AND c8 AND c9) AND not daysForbiddenEntry THENSELLSHORT 1 CONTRACT AT MARKETENDIF// Conditions pour fermer une position en vente à découvertindicator14 = Average[5](high)c10 = (close >= indicator14)IF c10 THENEXITSHORT AT MARKETENDIF03/07/2025 at 8:59 PM #244761Désolé, mais ce que vous avez écrit n’est pas mon code.
Si vous souhaitez utiliser ce que vous avez écrit, vous devez mettre, à la ligne 7, les instructions suivantes pour définir les bougies Heikin Ashi :1234567once xOpen = openxClose = (open + close + high + low) / 4if barindex > 0 thenxOpen = (xOpen[1] + xClose[1]) / 2endifxLow = min(low,min(xClose,xOpen))xHigh = max(high,max(xClose,xOpen))Après il faut remplacer :
- Close avec xClose
- Open avec xOpen
- High avec xHigh
- Low avec xLow
03/09/2025 at 1:33 PM #244776Bonjour,
Merci, j’ai essayé et cela fonctionne maintenant avec les bougies Heikin Ashi.
Par contre, j’ai toujours le problème avec les volumes. Je vous joints une photo pour que vous compreniez ce qui ne fonctionne pas.
Je souhaite que pour un achat, les volumes soit haussier et vis versa pour une vente.
D’autre part, pensez vous qu’il serait possible d’ajouter deux fonctions :
- Une pour fixer un BE à un nombre de points X
- Et une pour couper une partie X des positions lorsqu’on a atteint un nombre de points X
Je vous remercie vraiment pour votre aide.
Bon week-end
03/13/2025 at 11:49 AM #244907Bonjour,
Je reviens vers vous car je ne sais pas si vous avez vu mon message.
Je suis désolé de vous relancer mais j’aimerais avoir votre aide pour essayer de finaliser mon code.
Merci d’avance pour votre retour.
Bonne journée
03/17/2025 at 3:12 PM #244988Essayez ceci :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657defparam preloadbars = 0ONCE N = 7 //Periods// Bougies Heikin AshixOpen = openxClose = (open + close + high + low) / 4IF BarIndex > 0 THENxOpen = (xOpen[1] + xClose[1]) / 2ENDIF// Calculer la SMASma = average[N,0](xClose)// Calculer la SMA des volumesONCE SmaVolL = 0ONCE SmaVolS = 0ONCE maVolL = 0ONCE maVolS = 0Bullish = xClose > xOpenBearish = xClose < xOpenIF BarIndex > (N * 2) THENIF Bullish THENmaVolL = volumeSmaVolL = SmaVolL - maVolL[N] + maVolLELSIF Bearish THENmaVolS = volumeSmaVolS = SmaVolS - maVolS[N] + maVolSENDIFENDIFVolSmaL = SmaVolL / NVolSmaS = SmaVolS / N// Conditions d'entréeL1 = xClose > SmaS1 = xClose > SmaL2 = volume > VolSmaLS2 = volume > VolSmaSL3 = Not OnMarketS3 = Not OnMarketL4 = BullishS4 = BearishCondL = L1 AND L2 AND L3 AND L4CondS = S1 AND S2 AND S3 AND S4// Entrées sur le marchéIF CondL THENBUY 1 CONTRACT AT MARKETELSIF CondS THENSELLSHORT 1 CONTRACT AT MARKETENDIFSET STOP %LOSS 0.5SET TARGET %PROFIT 1////graph SmaVolL AS "SmaVolL" coloured("Blue")//graph maVolL AS "maVolL" coloured("Black")//graph VolSmaL AS "VolSmaL" coloured("Cyan"////graph SmaVolS AS "SmaVolS" coloured("Red")//graph maVolS AS "maVolS" coloured("Black")//graph VolSmaS AS "VolSmaS" coloured("Fuchsia")//graph Bullish//graph Bearish coloured("Red")L’indicateur VOLUME de la plateforme colore l’histogramme en fonction des bougies japonais réguliers.
Si vous souhaitez avoir le volume basé sur les bougies HA, vous devez utiliser cet indicateur :
123456789101112131415161718// Bougies Heikin AshixOpen = openxClose = (open + close + high + low) / 4IF BarIndex > 0 THENxOpen = (xOpen[1] + xClose[1]) / 2ENDIF//,volume HA candlesBullish = xClose > xOpenBearish = xClose < xOpenr = 0g = 205b = 0IF Bearish THENr = 205g = 92b = 92ENDIFRETURN Volume style(histogram) coloured(r,g,b,255) AS "Volume" -
AuthorPosts
Find exclusive trading pro-tools on