Indicatore senza dati del fine settimana
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Indicatore senza dati del fine settimana
- This topic has 9 replies, 3 voices, and was last updated 5 years ago by
Hendrix.
-
-
05/27/2019 at 9:15 AM #99500
Buongiorno,
ho un indicatore che determina degli obbiettivi in base alla max e min del giorno precedente,
funziona correttamente tutti i giorni tranne il lunedì in quanto reperisce il min e max della domenica (è utilizzato su IG con i cfd).
Sarebbe possibile farlo funzionare solo dal lunedì al venerdì?
In questo modo avrei gli obbiettivi corretti calcolati sul venerdì il lunedì mattina?
Grazie
1234567891011121314151617181920212223242526272829303132defparam calculateonlastbars=3000ONCE Prec1730 = closeONCE Prec2200 = closeIF opentime = 080000 THENApertura = openENDIFIF opentime = 173000 THENOggi1730 = closeENDIFIF opentime = 220000 THENOggi2200 = closeENDIFIF IntraDayBarIndex = 0 THENPrec1730 = Oggi1730Prec2200 = Oggi2200ENDIFNumeroBarra = 2IF OpenDayOfWeek > 1 THENNumeroBarra = 1ENDIFMaxGiornoPrec = Dhigh(NumeroBarra)MinGiornoPrec = Dlow(NumeroBarra)Pivot = (DHigh(1) + DLow(1) + DClose(1))/3 //PivotRes1 = (2*Pivot) - DLow(1) //Res1Sup1 = (2*Pivot) - DHigh(1) //Sup1Ob1 = Apertura + ((Res1 - Sup1) *0.3)Ob2 = Apertura - ((Res1 - Sup1) *0.3)Ob3 = Apertura + ((Res1 - Sup1) *0.5)Ob4 = Apertura - ((Res1 - Sup1) *0.5)RETURN MaxGiornoPrec COLOURED(0,255,0) AS "MaxGGprec",MinGiornoPrec COLOURED(255,0,0) AS "MinGGprec",Prec1730 COLOURED(0,255,255) AS "17:30 prec",Prec2200 COLOURED(0,255,255) STYLE(dottedline,3) AS "22:00 prec",Apertura COLOURED(255,0,255) STYLE(dottedline,3) AS "Apertura",Ob1 COLOURED(255,0,255) AS "Obbiettivo1",Ob2 COLOURED(255,0,255) AS "Obbiettivo2", Ob3 COLOURED(255,0,255) AS "Obbiettivo3",Ob4 COLOURED(255,0,255) AS "Obbiettivo4"05/27/2019 at 9:30 AM #9950105/27/2019 at 9:45 AM #9950605/27/2019 at 9:48 AM #99508Si, in effetti il titolo è opportuno che suggerisca meglio ciò di cui si tratta, anche perché è più facile che qualcuno sia interessato a rispondere, oltre a facilitare le ricerche. L’ho cambiato io.
Il codice aggiornato per funzionare dal lunedì al venerdì è:
12345678910111213141516171819202122232425262728293031323334defparam calculateonlastbars=3000ONCE Prec1730 = closeONCE Prec2200 = closeIF OpenDayOfWeek >= 1 AND OpenDayOfWeek <= 5 THEN //Lunedì - VenerdìIF opentime = 080000 THENApertura = openENDIFIF opentime = 173000 THENOggi1730 = closeENDIFIF opentime = 220000 THENOggi2200 = closeENDIFIF IntraDayBarIndex = 0 THENPrec1730 = Oggi1730Prec2200 = Oggi2200ENDIFNumeroBarra = 2IF OpenDayOfWeek > 1 THENNumeroBarra = 1ENDIFMaxGiornoPrec = Dhigh(NumeroBarra)MinGiornoPrec = Dlow(NumeroBarra)ENDIFPivot = (DHigh(1) + DLow(1) + DClose(1))/3 //PivotRes1 = (2*Pivot) - DLow(1) //Res1Sup1 = (2*Pivot) - DHigh(1) //Sup1Ob1 = Apertura + ((Res1 - Sup1) *0.3)Ob2 = Apertura - ((Res1 - Sup1) *0.3)Ob3 = Apertura + ((Res1 - Sup1) *0.5)Ob4 = Apertura - ((Res1 - Sup1) *0.5)RETURN MaxGiornoPrec COLOURED(0,255,0) AS "MaxGGprec",MinGiornoPrec COLOURED(255,0,0) AS "MinGGprec",Prec1730 COLOURED(0,255,255) AS "17:30 prec",Prec2200 COLOURED(0,255,255) STYLE(dottedline,3) AS "22:00 prec",Apertura COLOURED(255,0,255) STYLE(dottedline,3) AS "Apertura",Ob1 COLOURED(255,0,255) AS "Obbiettivo1",Ob2 COLOURED(255,0,255) AS "Obbiettivo2", Ob3 COLOURED(255,0,255) AS "Obbiettivo3",Ob4 COLOURED(255,0,255) AS "Obbiettivo4"05/27/2019 at 9:52 AM #99509Non l’ho provato, semmai sposta la riga 24 (ENDIF) alla 33, magari aggiungendo tre spazi iniziali alle righe 26-32 ma questo non è necessario.
05/27/2019 at 10:04 AM #9951005/27/2019 at 10:16 AM #99513Allega una foto del grafico, indicando:
- strumento
- TF
- date di riferimento
- valori corretti che avrebbero dovuto essere visualizzati
05/27/2019 at 10:32 AM #9951405/27/2019 at 10:44 AM #99516Questo perché il lunedì gli hai indicato (1) con DCLOSE….., quindi il giorno precedenbte che è domenica, mentre deve essere indicato (2) per fargli prendere i dati del venerdì. Le righe 26-28 scrivile così, aggiungendo prima le altre 4:
1234567x = 1IF OpenDayOfWeek = 1 THENx = 2ENDIFPivot = (DHigh(x) + DLow(x) + DClose(x))/3 //PivotRes1 = (2*Pivot) - DLow(x) //Res1Sup1 = (2*Pivot) - DHigh(x) //Sup105/27/2019 at 10:55 AM #99517 -
AuthorPosts
Find exclusive trading pro-tools on