Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

chrisleonard

Multiple Customer Id's

Recommended Posts

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

 

;-)>

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.