TimeOk till 3.31pm

#1
tn = TimeNum();
startTime = 091759; // start in HHMMSS format
endTime = 153159; // end in HHMMSS format

timeOK = tn >= startTime AND tn <= endTime;

// following line is not working
// after 3.31pm my code should stop shell execution. Pls help if any other alternative strategy.

// without timeOK codes are running fine but with I want endTime so that it will not work after 3.31pm

if ( NewPeriod )
{
ShellExecute("wscript.exe", "intraday.js", ".\\Scripts") AND TimeOK:
}
 
#2
I am not a JS expert, but from what you are doing, logic seems wrong.
TimeOk is a bool ? is this snipper running within a service..
if this snippet is running in service, you have to sendout Terminate event i.e

tn>endTime
TerminateProcess(shellExInfo.hProcess, 1);
 
#3
I am not a JS expert, but from what you are doing, logic seems wrong.
TimeOk is a bool ? is this snipper running within a service..
if this snippet is running in service, you have to sendout Terminate event i.e

tn>endTime
TerminateProcess(shellExInfo.hProcess, 1);
This is not js script.. It's AFL CODES
 
#7
i am browsing from NY, u can post ur comment here no issues.. i think its an issue with logic, that should fix it..
Pls tell me logic.

Currently codes are running fine without timeOk.

But I wish to set end time till 3.31 pm
Since Market close at 3.30

If u hv better logic let me know.
 
#9
tn = TimeNum();
startTime = 091759; // start in HHMMSS format
endTime = 153159; // end in HHMMSS format

timeOK = tn >= startTime AND tn <= endTime;

// following line is not working
// after 3.31pm my code should stop shell execution. Pls help if any other alternative strategy.

// without timeOK codes are running fine but with I want endTime so that it will not work after 3.31pm

if ( NewPeriod )
{
ShellExecute("wscript.exe", "intraday.js", ".\\Scripts") AND TimeOK:
}
Wrong code, here's corrected.

tn = TimeNum();
startTime = 091759; // start in HHMMSS format
endTime = 153159; // end in HHMMSS format

timeOK = tn >= startTime AND tn <= endTime;

// following line is not working
// after 3.31pm my code should stop shell execution. Pls help if any other alternative strategy.

// without timeOK codes are running fine but with I want endTime so that it will not work after 3.31pm

if ( SelectedValue(timeOK))
{
ShellExecute("wscript.exe", "intraday.js", ".\\Scripts");
}
 
#10
Wrong code, here's corrected.

tn = TimeNum();
startTime = 091759; // start in HHMMSS format
endTime = 153159; // end in HHMMSS format

timeOK = tn >= startTime AND tn <= endTime;

// following line is not working
// after 3.31pm my code should stop shell execution. Pls help if any other alternative strategy.

// without timeOK codes are running fine but with I want endTime so that it will not work after 3.31pm

if ( SelectedValue(timeOK))
{
ShellExecute("wscript.exe", "intraday.js", ".\\Scripts");
}
Following are original code, running fine on my pc.

Please help me to add timeOK check.



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 );

tn = TimeNum();
startTime = 091759; // start in HHMMSS format
endTime = 155059; // end in HHMMSS format

timeOK = tn >= startTime AND tn <= endTime;

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



if ( NewPeriod ) // every 1 min copying chart as image and this is running fine using this since last 1 year, hence pls help me to add timeOK check.


{
ShellExecute("wscript.exe", "intraday.js", ".\\Scripts"); // AND TimeNum()<=130659 ; //AND today !=0 OR today !=6 ;
}