Bonjour Nicolas (et ChatGPT 🙂 ),
J’ai anticipé hier la solution que tu propose par le biais d’un CALL depuis un autre indicateur.
Je n’ai pas d’erreur généré mais la donnée retourné ne correspond pas.
Dans cet exemple je cherche à récuperer dans un tableau le nombre de minute en UT5 et UT1.
Voici une synthèse de mon code (le code est trop long sinon) pour illustrer ma tentative :
Indicateur principal :
UT = gettimeframe/60
//TimeFrame (5 minute)
IF UT<=5 then
myVUT5M200,ignored = CALL "MonCallUTF"[1,1]
//// ******* Colonne 12 *********//
DrawRectangle(Dr+(BoxLarge*11)-AjustBox,Ha-BoxHaut,Dr+(BoxLarge*10)-AjustBox,Ha) anchor(TopLeft) coloured(400,200,200,100) borderColor(50,10,10,80) // Boîte 2
DrawText("5 MN",Dr+(BoxLarge*10)+(BoxLarge/2)-AjustBox, Ha-(BoxHaut/2), dialog, standard,14)anchor(TopLeft)
DrawRectangle(Dr+(BoxLarge*11)-AjustBox,Ha-(BoxHaut*2),Dr+(BoxLarge*10)-AjustBox,Ha-BoxHaut) anchor(TopLeft) coloured(400,200,200,100) borderColor(50,10,10,80) //
DrawText("#myVUT5M200#",Dr+(BoxLarge*10)+(BoxLarge/2)-AjustBox, Ha-BoxHaut-(BoxHaut/2), dialog, standard,14)anchor(TopLeft)
ELSE
AjustBox = BoxLarge*11
ENDIF
IF UT<=1 then
ignored,myVUT1M200 = CALL "MonCallUTF"[1,1]
//// ******* Colonne 13 *********//
DrawRectangle(Dr+(BoxLarge*12)-AjustBox,Ha-BoxHaut,Dr+(BoxLarge*11)-AjustBox,Ha) anchor(TopLeft) coloured(400,200,200,100) borderColor(50,10,10,80) // Boîte 2
DrawText("1 MN",Dr+(BoxLarge*11)+(BoxLarge/2)-AjustBox, Ha-(BoxHaut/2), dialog, standard,14)anchor(TopLeft)
DrawRectangle(Dr+(BoxLarge*12)-AjustBox,Ha-(BoxHaut*2),Dr+(BoxLarge*11)-AjustBox,Ha-BoxHaut) anchor(TopLeft) coloured(400,200,200,100) borderColor(50,10,10,80) //
DrawText("#myVUT1M200#",Dr+(BoxLarge*11)+(BoxLarge/2)-AjustBox, Ha-BoxHaut-(BoxHaut/2), dialog, standard,14)anchor(TopLeft)
ELSE
AjustBox = BoxLarge*12
ENDIF
TIMEFRAME(default)
Return
Ici mon indicateur appelé via CALL (MonCallUTF) :
timeframe(5 minute)
a = gettimeframe/60
timeframe(1 minute)
b = gettimeframe/60
return a as "5SM200",b as "1SM200"
Je devrais retourner les valeur “5” en UT5 et “1” en UT1 mais voici ce que j’obtiens dans mon tableau (les valeurs de l’unité par défaut soit 1 min) :