J'ai un petit soucis d'affichage des plus haut/bas M/H/J de la période (M/H/J) précédente sur prt (10.3)
Voici le code que j'utilise :
Code : #
once monthlyHigh = undefined
once monthlyLow = undefined
once dailyHigh = undefined
once dailyLow = undefined
//lastDayOfWeek = -1
IF dayofweek < dayofweek[1] THEN
weekhigh = prevweekhigh
weeklow = prevweeklow
prevweekhigh = high
prevweeklow = low
ENDIF
prevweekhigh = max(prevweekhigh, high)
prevweeklow = min(prevweeklow, low)
IF DayOfWeek <> 0 and DayOfWeek <> 6 and Day <> Day[1] THEN
dailyHigh = DHigh(1)
dailyLow = DLow(1)
lastDayBarIndex = BarIndex
ENDIF
IF Month <> Month[1] THEN
monthlyHigh = Highest[BarIndex - lastMonthBarIndex](dailyHigh)
monthlyLow = Lowest[BarIndex - lastMonthBarIndex](dailyLow)
lastMonthBarIndex = BarIndex
ENDIF
DRAWTEXT("daily High", lastDayBarIndex + 50, dailyHigh + 3, SansSerif, Bold, 16)coloured(153,153,0)
DRAWTEXT("daily Low", lastDayBarIndex + 50, dailyLow + 3, SansSerif, Bold, 16)coloured(153,153,0)
DRAWTEXT("weekly High", lastDayBarIndex + 80, weekhigh + 3, SansSerif, Bold, 16)coloured(153,153,0)
DRAWTEXT("weekly Low", lastDayBarIndex + 80, weeklow + 3, SansSerif, Bold, 16)coloured(153,153,0)
DRAWTEXT("Pref Month High", lastDayBarIndex + 100, monthlyHigh + 3, SansSerif, Bold, 16)coloured(153,153,0)
DRAWTEXT("Pref Month Low", lastDayBarIndex + 100, monthlyLow + 3, SansSerif, Bold, 16)coloured(153,153,0)
return dailyHigh as "dailyHigh", dailyLow as "dailyLow", monthlyHigh as "Prev Month High", monthlyLow as "Prev Month Low", weekhigh as "prev week high", weeklow as "prev week low"
Les lignes épaisses en violet correspondent aux 6 lignes de prix de prt pour afficher les plus haut/bas M/H/J.
Les lignes noires plus fines annotées sont l'indicateur
On voit clairement le décalage. Il y a un décalage.
Quelqu'un a-t-il un code qui donne des résultats exacts ?
Je précise que j'ai déjà du désactiver l'option "Afficher les données du weekend" dans "Horaires de trading personnalisés" pour des problèmes antérieurs d'affichage des points pivots.
J'ai une deuxième question l'indicateur prt considère le passage de période à 01H00 du matin. Que conseillez-vous comme paramètre ?
Merci par avance à tout ceux qui peuvent m'aider.
pat.