Clock

#1
Buenas noches:

Esta es mi primera comunicacin en este foro y siento no poder escribir en ingles. Empleo para entenderme un traductor automatico y me va bastante bien.
Necesito un reloj que me diga cuanto tiempo le falta a la vela para finalizar.
Tengo un AFL que me funciona bien en 1 minuto, pero no en el resto de los tiempos, en particular en 3 minutos. Alguien me puede ayudar y enviarme un AFL que funcione en 3 minutos.
El cdigo que uso en 1 minuto es el siguiente y no entiendo porque no funciona en 3 minutos. Gracias

Good night:

This is my first communication in this forum and I feel not to be able to write in English. Use to understand an automatic translator to me and goes to me rather well.
I need a clock that says to me how long needs to the candle to finalize.
I have a AFL that works to me well in 1 minute, but not in the rest of the times, in particular in 3 minutes. Somebody can help and send a AFL to me me that works in 3 minutes.
The code that use in 1 minute is the following one and I do not understand because it does not work in 3 minutes. Thanks

CODE:
// Timer

tempnum = Now( 4 ) - TimeNum();
TimeRem = Interval() - ((int(tempnum[BarCount - 1] / 100) * 60) + (tempnum[BarCount - 1] - int(tempnum[BarCount - 1] / 100) * 100));
if (TimeRem[BarCount - 1] < 0) TimeRem = 0;
MinuteVar = int(TimeRem / 60);
SecondsVar = int(frac(TimeRem / 60) * 60);
if (TimeRem[BarCount - 1] > 60)
{
TitleTimeRem = EncodeColor(colorWhite) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar;
}
else if (TimeRem[BarCount - 1] > 20)
{
TitleTimeRem = EncodeColor(colorBlue) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar;
}
else
{
TitleTimeRem = EncodeColor(colorBlue) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar;
}


// Tic/PIP value

TicMult= Param("Tic multiplier(ER2=10,YM=1,ES=4,FOREX=1)",1,0,1000000);
TicDiv= Param("Tic or PIP value(ER2=0.1,YM=1,FOREX=1)",1,0,1000000);

// Rangebar interval

rbint= Param("Rangebar interval:(YM=25.0,AB=1.5,NQ=3.75,ES=3.0)",1.0,0.25,1000000);

// Rangebar counter

rbcounter= round(((rbint-(H-L))) * ticmult);
rbcounterpercent= round((rbcounter/(rbint * ticmult))*100);

// Timer/counter title

timercode= Param("Timer:(minutes=1,rangebar=2)",1,1,2);
timetitle= WriteIf(timercode==1,TitleTimeRem, EncodeColor(colorBlack)+ "Countdown " + rbcounter + " (" + rbcounterpercent + "%)");


// Price Panel

Closecolor=WriteIf(C==H AND H>Ref(H,-1),EncodeColor(colorWhite),WriteIf(C==L AND L<Ref(L,-1),EncodeColor(colorWhite),EncodeColor(colorWhite)));

// Title



Title = "\n" + "" + EncodeColor(colorWhite) + Date() + "\n" + "\n" +
timetitle + "\n" + "\n";


_SECTION_END();
 

netman

Active Member
#2
any minute which can get you profit is acceptable,
why you want 3 minutes to know a signal
when every second costs atleast something to a individual.
 
#3
Trabajo habitualmente con grficos de 1 y 3 minutos y opero segn el grafico de 3 minutos, siendo importante para mi saber cuando cierra la vela para prepararme a entrar en mercado.

Saludos,

Work habitually with graphs of 1 and 3 minutes and I operate according to the diagram of 3 minutes, being important my knowledge when it closes the candle to prepare to me to enter market.

Greetings,
 

bharatk8

Active Member
#4
_SECTION_BEGIN("Time Left");
function GetMinuteNum()
{
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
MinuteNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
return MinuteNum;
}
RequestTimedRefresh( 1 );
TimeFrame = Interval();
MinuteNumber = GetMinuteNum();
Newperiod = MinuteNumber % TimeFrame == 0;
MinuteLeft = MinuteNumber - int( MinuteNumber / TimeFrame ) * TimeFrame;
MinuteToGo = TimeFrame - MinuteLeft;

x=Param("xposn",918,0,1000,1);
y=Param("yposn",586,0,1000,1);

GfxSelectSolidBrush( ColorRGB( 230, 230, 230 ) );
GfxSelectPen( ColorRGB( 230, 230, 230 ), 2 );
if ( NewPeriod )
{
GfxSelectSolidBrush( colorYellow );
GfxSelectPen( colorYellow, 2 );
Say( "New period" );
}
GfxRoundRect( x+55, y+17, x-4, y-2, 0, 0 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 9, 700, False );
GfxSetTextColor( colorBlack );
GfxTextOut( ""+MinuteToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
_SECTION_END();
 

pkgmtnl

Well-Known Member
#6
What VXL has given it require adjustment of display.
U can use this

_SECTION_BEGIN("Time Left");
function GetSecondNum()
{
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
return SecondNum;
}

RequestTimedRefresh( 1 );
TimeFrame = Interval();
SecNumber = GetSecondNum();
Newperiod = SecNumber % TimeFrame == 0;
SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
SecsToGo = TimeFrame - SecsLeft;

if ( NewPeriod )
{
Say( "New period" );
Plot( 1, "", colorYellow, styleArea | styleOwnScale, 0, 1 );
}

Title = "\n" +

" Current Time: " + Now( 2 ) + "\n" +
"Chart Interval: " + NumToStr( TimeFrame, 1.0 ) + " Seconds\n" +
" Second Number: " + NumToStr( SecNumber, 1.0, False ) + "\n" +
" Seconds Left: " + NumToStr( SecsLeft, 1.0, False ) + "\n" +
" Seconds To Go: " + NumToStr( SecsToGo, 1.0, False );
 

Similar threads