TradeStation: Check Session in EL

Sometimes, you would need to check the data stream session in your code. you can use the following

using elsystem; 
 
variables: 
	int Index( 0 ), 
	DataStream DS( NULL ), 
	float Flt(0); 
 
Once 
Begin 
	ClearPrintLog(); 
	Print("Count: ",  AnalysisTechnique.datastreams.Count:0:0); 
	 
	for Index = 0 to analysistechnique.datastreams.Count - 1 
	begin 
		DS = analysistechnique.datastreams.Stream[Index]; 
		print(index:0:0, " ", DS.DataNum:0:0, " ", DS.SessionName); 
	end; 
	 
	 
	DS = AnalysisTechnique.DataStreams.DefaultStream; 
	Print("Default DataNum=", DS.DataNum, " TimeZone=", DS.timeZone.ToString()); 
	 
	DS = AnalysisTechnique.DataStreams[0];	 
	Print("DataStreams[0]=", DS.DataNum); 
	 
	DS = AnalysisTechnique.DataStreams.StreamFromDataNum[0];	 
	Print("StreamFromDataNum[0]=", DS.DataNum); 
end;

DISCLAIMER – READ ME!

THESE INDICATORS, SHOW ME STUDIES, STRATEGIES AND OTHER PROGRAMS / ALGORITHMS HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES.

NIK IZWAN KAMEL ASSUMES NO LIABILITY FOR ANY DAMAGES, DIRECT OR OTHERWISE, RESULTING FROM THE USE OF THIS INFORMATION AND/OR PROGRAM(S) DESCRIBED, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION AND/OR PROGRAMS DESCRIBED IS AT YOUR OWN RISK.

TradeStation®, EasyLanguage® and PowerEditor® are registered trademarks of TradeStation Technologies, Inc. Other brand and product names which appear on this site such as AmiBroker® and MultiCharts® are the trademarks or service marks of their respective owners.  Microsoft® is a registered trademark in the United States Microsoft®Excel® is a registered trademark of Microsoft® Neither TradeStation Technologies nor any of its affiliates has reviewed, certified, endorsed, approved, disapproved or recommended, and neither does or will review, certify, endorse, approve, disapprove or recommend, any product or service that offers training, education or consulting regarding the use of EasyLanguage.  AmiBroker nor any of its affiliates has reviewed, certified, endorsed, approved, disapproved or recommended, and neither does or will review, certify, endorse, approve, disapprove or recommend, any product or service that offers training, education or consulting regarding the use of its proprietary AmiBroker Formula Language. MultiCharts nor any of its affiliates has reviewed, certified, endorsed, approved, disapproved or recommended, and neither does or will review, certify, endorse, approve, disapprove or recommend, any product or service that offers training, education or consulting regarding the use of its PowerLanguage. 

Nik Izwan Kamel is an Entrepreneur who venture in multiple businesses in different industries including IT, Blockchain, E-Commerce, Security, Retail and F&B. A cryptocurrency enthusiast and cooking computer codes at night.

Leave a reply:

Your email address will not be published.

Site Footer