How to filter stocks by TIME in explorer

madhavareddy1203

Well-Known Member
#1
Plz help me to filter stocks by signal time in amibroker explorer.

Unable to filter stocks by time in ascending or descending. remianing filter working fine in amibroker explorer.
 

madhavareddy1203

Well-Known Member
#5


Thanks Amit..

My problem:
When i click on Full name or buy above or sell below its sorting correctly.

But when i click on date and time its not sorting correctly.. Im facing difficult to find latest signals.

I tried different ways but not filtering.

Plz show me solution to filter.


code:

Filter=Buy OR Sell;
AddTextColumn( Name(), "Full Name", 77, colorDefault,IIf( Buy, colorGreen, IIf(Sell,colorRed ,colorDefault )) );

AddColumn( IIf(Buy,H,Null), "Buy Above",1.2 );
AddColumn( IIf(Sell,L,Null), "Short Below");




Another solution:

Plz say how to add time coloumn (Signal generated time in 24 hour format)in explorer. By 24 hour format i can easily find latest signals. IM intraday trader.. so i need todays signals only..


Thanks in advance..
 
Last edited:

amitrandive

Well-Known Member
#6


Thanks Amit..

My problem:
When i click on Full name or buy above or sell below its sorting correctly.

But when i click on date and time its not sorting correctly.. Im facing difficult to find latest signals.

I tried different ways but not filtering.

Plz show me solution to filter.


code:

Filter=Buy OR Sell;
AddTextColumn( Name(), "Full Name", 77, colorDefault,IIf( Buy, colorGreen, IIf(Sell,colorRed ,colorDefault )) );

AddColumn( IIf(Buy,H,Null), "Buy Above",1.2 );
AddColumn( IIf(Sell,L,Null), "Short Below");




Another solution:

Plz say how to add time coloumn (Signal generated time in 24 hour format)in explorer. By 24 hour format i can easily find latest signals. IM intraday trader.. so i need todays signals only..


Thanks in advance..
Add this line to your code

AddColumn( DateTime(), "Date", formatDateTime );

Also AmiBroker setting for your database change as
File===Database Settings
Also you need to single click on the Date/Time column
Let me know if this works

 

madhavareddy1203

Well-Known Member
#7
Add this line to your code

AddColumn( DateTime(), "Date", formatDateTime );

Also AmiBroker setting for your database change as
File===Database Settings
Also you need to single click on the Date/Time column
Let me know if this works

Checked... not working..

I dont want date..... only time is enough for me.. thats also in 24 hour format..
 

sr114

Well-Known Member
#8
Checked... not working..

I dont want date..... only time is enough for me.. thats also in 24 hour format..

Use this to get sorted output in either ascending or in descending order

SetSortColumns( col1, col2, .... ) ;

FUNCTION sets the columns which will be used for sorting. col1, col2, ... col10 -Column numbers are ONE-based. Positive number means sort ASCENDING, negative number means sort DESCENDING. Upto 10 columns can be specified for multiple-column sort. Each subsequent call to SetSortColumns overwrites previous one, but multiple SetSortColumns make sense if you want to add multiple rankings by different columns via AddRankColumn
so which col u want sorted, use that in the function in the exploration. in ur case sort on col 1.

also use the following function to get the time part

Now( format = 0 ) :
FUNCTION Returns current date / time in numerous of formats:
format = 0 - returns string containing current date/time formatted according to system settings
format = 1 - returns string containing current date only formatted according to system settings
format = 2 - returns string containing current time only formatted according to system settings
format = 3 - returns DATENUM number with current date
format = 4 - returns TIMENUM number with current time
format = 5 - returns DATETIME number with current date/time
to get time in 24 hr format, set ur system time accordingly in 24 hr format

thanx
Subroto
 
Last edited:

amitrandive

Well-Known Member
#9
Checked... not working..

I dont want date..... only time is enough for me.. thats also in 24 hour format..
MadhavJi

Date time is a predefined function in Amibroker.
Need to convert the time in exploration by using

DateTimeConvert( format, date, time = Null )
myhour = DateTimeConvert( 5, DateTime() );

Issue is I do not know how to do that :confused::confused:

My question to you is why are you not able to single click on the first column of the exploration and get the required result.
 

madhavareddy1203

Well-Known Member
#10
Sorry guys,

I tried above all methods but not working as per my requrement.

1. Now( format = 0 ) :

If i use this .. im getting current time in explorer... not signal generated time.

2. AddColumn( DateTime(), "Date", formatDateTime );
If i use this function im getting signal generated time.. and along with date.

i dont want date. i need only time. Cos of date its not filtering correctly.


Plz suggest code to add only time.. ex: 13:35

I have changed my system setting to 24 hour format.

PHP:
Periods=Param("Periods",15,3,70,2);
SmoothFactor = Param("SM",5,3,14,1);
Levelup= 70;
Leveldown=30;
R= RSI(Periods);
StochR=100*(R-LLV(R,periods))/(HHV(R,periods)-LLV(R,periods));
SR=EMA(StochR,SmoothFactor);
Buy= Cross( SR,Leveldown);
Sell= Cross(Levelup,SR);
Buy= ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0,C, Offset=-15); 
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed, 0,C, Offset=-15);

Filter=Buy OR Sell;

AddTextColumn( Name(), "Full Name", 77, colorDefault,IIf( Buy, colorGreen, IIf(Sell,colorRed ,colorDefault )) );

//AddTextColumn( TimeNum(),"time" , 77 , colorDefault, IIf( Buy, colorGreen, IIf(Sell,colorRed ,colorDefault )) );
//AddTextColumn(TimeNum(),"date",77,IIf( Buy, colorGreen, IIf(Sell,colorRed ,colorDefault )) );
//AddTextColumn( Now( format = 2 ),"time",77, IIf( Buy, colorGreen, IIf(Sell,colorRed ,colorDefault ))); 
//AddColumn( DateTime(), "Date", formatDateTime );

AddColumn( IIf(Buy,C,Null), "Buy ",1.2 );

AddColumn( IIf(Sell,C,Null), "Short "); 


 
SetSortColumns( -4 );// AND SetSortColumns( -8 );