Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 07-05-2010, 10:16 AM   #1

Join Date: Jun 2009
Location: hemel
Posts: 87
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Multiple Customer Id's

Hi
Is there anyway to use multiple customer id's in 1 eld file

Like

if customerid = 998976 or 887889 then begin???

I code alot of eld's for 100 customers and individually it takes ages!!

Thanks

Chris
chrisleonard is offline  
Reply With Quote
Old 07-05-2010, 10:19 AM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Multiple Customer Id's

Quote:
Originally Posted by chrisleonard »
Hi
Is there anyway to use multiple customer id's in 1 eld file

Like

if customerid = 998976 or 887889 then begin???

I code alot of eld's for 100 customers and individually it takes ages!!

Thanks

Chris

.......... have you tried?
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 07-05-2010, 10:20 AM   #3

Join Date: Jun 2009
Location: hemel
Posts: 87
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Re: Multiple Customer Id's

Yes it would not verify it said I can't do that
chrisleonard is offline  
Reply With Quote
Old 07-05-2010, 11:03 AM   #4

Join Date: Jun 2009
Location: hemel
Posts: 87
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Re: Multiple Customer Id's

Anyone else manages
Do to do this??

My plans are to update my indicators when I find better settings but updAting 100 eld's is a pain

Thanks
chrisleonard is offline  
Reply With Quote
Old 07-05-2010, 11:25 AM   #5

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Multiple Customer Id's

Quote:
Originally Posted by chrisleonard »
Anyone else manages
Do to do this??

My plans are to update my indicators when I find better settings but updAting 100 eld's is a pain

Thanks
I can do it for you for $1 each.

;-)>
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 09-03-2010, 11:55 PM   #6

Join Date: Apr 2007
Location: Santa Ana
Posts: 2
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Multiple Customer Id's

Yes you can, but it is a little more complicated. I unfortunately do not have the time to write the code, but I will briefly explain the "process".

The probable error in your code is that you did not form the "or" statement correctly. It needs to be:

if CustomerID = 998976
or CustomerID = 887889
//or CustomerID = <next ID here>
then
ValidUser = 1;

Code this into a FUNCTION.

I suggest you name your "working function" with a _O (say for Open)
then create a copy with a _P (say for Protected)
You want to do this, because in a second you will incapacitate the original, and you don't want to have to enter in the whole list again later.

Export the _P version of the code as a EasyLanguage protected file. (to a known file folder location)
Immediately import it back in. tradestation will ask you if you want to overwrite the non-protected version -- answer Yes. If you do this correctly, the Code Editor will then show that the _P version is now protected, if you still have it open.

In your EZL study (Indicator, ShowMe, PaintBar, Strategy, etc.), check for a Valid User.
I like to use the "Once" syntax, so it does not need to be evaluated constantly.

In your variables, set ValidUser(0), then when the function passes in "1", you know that you have a valid user. Use an IF-THEN statement to check for ValidUser = 1. If ValidUser is still zero, then call a RaiseRuntimeError. This halts the study and it will not run, and puts an error message up that the user can see.

Note: Using this method, obviously ALL ValidUsers have access to all studies coded in this manner. So additional thought would be required if you need to restrict access, by possibly grouping studies and using different functions with unique ValidUser lists.

Many programmers combine the ValidUser check with an expiration date to time-out and halt operation of the study after a certain period of time (i.e. month, half-year, year, etc.).

Hope this helps.
Daawg is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
One Big Screen or Multiple Smaller Screens? daveyjones Tools of the Trade 39 07-10-2010 01:50 PM

All times are GMT -4. The time now is 02:57 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.