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.

jeffersondaarcy

Trying to Learn EasyLanguage, but Stuck

Recommended Posts

Hey Guys,

I've spent the past week reading through the available online EasyLanguage PDFs in hopes of eventually creating some basic scans to help filter tradeable stocks. As an exercise, I figured I would create a ShowMe with a few conditions. The main condition is that the "last" is 10% greater than yesterday's close. I cant get this to work for the life of me. I have attached the code I am working with and a few screenshots of the ShowMe. You'll notice one of the screenshots is for a stock that is up 8% (not 10%). No clue why this stock meets the conditions. Any and all help, advice, etc. would be greatly appreciative to this newbie.

 

Variables:

FoundPattern( False );

 

Value1 = ((high+low)*.5);

 

Condition1= last>(close[1]+(Close[1]*.10));

Condition2= Volume[1]>300000;

Condition3= last>2 and last<60;

 

if Condition1 and condition2 and condition3 then

begin

foundpattern=true;

end;

 

if foundpattern then

begin

plot1 (value1);

end;

 

Thanks again.

Code.JPG.6f57030d734e930cc30acc2a0ce5e5f4.JPG

ALGN.JPG.ac6c90e4e6f5031b2a88dc2c71ec6f9b.JPG

Aria.JPG.f9367423b05170c2ba62ea4e295aee14.JPG

Share this post


Link to post
Share on other sites

try this:

 

if Condition1 and condition2 and condition3 then

begin

foundpattern=true;

end

else

begin

foundpattern=false;

end;

 

 

It is possible that the conditions were met at one point during intrabar,

but the scenario has changed by the end of the bar.

Thus you need the "escape clause".

 

 

 

p.s. I would avoid using the generic variables (value1, condition1, etc.).

They are convenient, but makes debugging difficult.

 

 

 

.

Edited by Tams

Share this post


Link to post
Share on other sites

p.s.

 

replace LAST with CLOSE

 

"CLOSE" is the last traded price.

 

"LAST" is also the last traded price.

LAST is designed to be used in a quote field, it does not reference historic data, therefore might not be usable in an analysis.

 

 

.

Edited by Tams

Share this post


Link to post
Share on other sites

Hi Tams,

Thanks for helping me out, I really I appreciate. I incorporated the escape clause and cleaned up my variables, so my code is tighter. I now have a new issue though. The screenshot speaks for itself (look at $26). Both versions of the below code give me the same plot result. Any suggestions in regards to where I am going wrong?

 

In regards, to your "last" vs. "close" post, I was hoping to run scans (via TS scanner) during trading hours; therefore, I was planning on using "last." Are their any issues with "last" and scans that I dont know about (I dont subscribe to Radarscan).

 

VERSION1

Variables: SMDot((high+low)*.50), FoundPattern(False);

 

Condition1= last>(close[1]+(Close[1]*.10));

Condition2= Volume[1]>300000;

Condition3= last>2 and last<60;

 

if Condition1 and Condition2 and Condition3 then

begin

FoundPattern=true;

end

else

begin

FoundPattern=false;

end;

 

if FoundPattern then

begin

plot1 (SMDot);

end;

 

VERSION2 (only difference between V2 and V1 is that V2 has an "escape clause" for the plot section as well)

 

Variables: SMDot((high+low)*.50), FoundPattern(False);

 

Condition1= last>(close[1]+(Close[1]*.10));

Condition2= Volume[1]>300000;

Condition3= last>2 and last<60;

 

if Condition1 and Condition2 and Condition3 then

begin

FoundPattern=true;

end

else

begin

FoundPattern=false;

end;

 

if FoundPattern then

begin

plot1 (SMDot);

end

else

begin

noplot(1);

end;

 

Thanks again Tams

ALGN2.JPG.98edcc5c848834d9624845d8a0df0ed7.JPG

Share this post


Link to post
Share on other sites

LAST is designed to be used in a quote field, it does not reference HISTORIC data.

 

 

 

 

HELLLLLOOOOOO... are you currently looking at LIVE data or HISTORIC data?

Edited by Tams

Share this post


Link to post
Share on other sites

you can simplify this

 

if Condition1 and Condition2 and Condition3 then

begin

FoundPattern=true;

end

else

begin

FoundPattern=false;

end;

 

 

to

 

FoundPattern = Condition1 and Condition2 and Condition3;

Share this post


Link to post
Share on other sites

Thanks Tams. I am looking to compare live data (the price of the last completed trade of a specific stock) to historical data (the previous day's close). I would like to be able to use this ShowMe study in the scanner during market hours to find tradeable opportunities.

 

I incorporated the changes and it appears the original issue is back (see screenshot).

 

Variables: SMDot(0), FoundPattern(False);

 

SMDot= ((high+low)*.50);

 

Condition1= last>(close[1]+(Close[1]*.10));

Condition2= Volume[1]>300000;

Condition3= last>2 and last<60;

 

FoundPattern= Condition1 and Condition2 and Condition3;

 

if FoundPattern then

begin

plot1 (SMDot);

end

else

begin

noplot(1);

end;

 

Judging by your responses, I assume this issue is a result of "last?"

 

Thanks

algn3.JPG.de34b64a5f065be1ae0de7538ba878c5.JPG

Share this post


Link to post
Share on other sites
...

In regards, to your "last" vs. "close" post, I was hoping to run scans (via TS scanner) during trading hours; therefore, I was planning on using "last." Are their any issues with "last" and scans that I dont know about (I dont subscribe to Radarscan).

 

 

 

 

p.s.

replace LAST with CLOSE

"CLOSE" is the last traded price.

"LAST" is also the last traded price.

LAST is designed to be used in a quote field, it does not reference historic data, therefore might not be usable in an analysis.

.

 

 

 

are you making a quote field? or are you doing analysis ?!?!

Share this post


Link to post
Share on other sites

Herein lies my confusion: The code references the "close" of yesterday's daily bar (close[1]); therefore, if I use "close" in regards to today, will the scan still work since technically the daily bar for today wont have a "close" for another six hours (assume it is 10:00am Eastern)? That is why I used "last," because I need the up-to-the-second price when running a scan (which is based off the ShowMe that identifies stocks that are up 10% or more on the day).

 

I obviously misconstrued something along the way when reading through the EasyLanguage PDFs. Your clarification is greatly appreciated. Thanks again.

Share this post


Link to post
Share on other sites

EasyLanguage is NOT English.

 

 

EasyLanguage is "English like".

 

 

do not put preconceived English meanings into EasyLanguage definitions.

 

 

 

.

Edited by Tams

Share this post


Link to post
Share on other sites
...I obviously misconstrued something along the way when reading through the EasyLanguage PDFs. Your clarification is greatly appreciated. Thanks again.

 

 

yes, you have obviously misconstrued something along the way.

 

Read my posts again. Everything you needed is there.

 

 

or if you prefer, you can refer to the EasyLanguage Dictionary for exact definitions and examples.

 

 

Good luck.

Edited by Tams

Share this post


Link to post
Share on other sites

Tams, as mentioned in the first post, my main intentions with the ShowMe study was simply to practice EasilyLanguage in hopes of becoming somewhat proficient. Scanning for stocks that are up 10% was simply an exercise I created for myself to test my understanding of EL. I guess I could have done a better job of explaining that.

 

I can read and re-read the definition of "last" or "quote field" a million times and they're never going to make sense to me. I'm obviously programming illiterate. My confusion isn't due to lack of effort. A simple explanation of "last," "quote field," and the programming relationship between "live and historic data" would be incredibly appreciated. I'm just looking for some help and trying to learn, that's all.

Share this post


Link to post
Share on other sites

I will give it one more effort...

 

please answer the questions to posts #5 and #9

 

 

 

computer is very dumb... so don't give any "if" or "but"...

Share this post


Link to post
Share on other sites

Thanks Tams

 

#5: My goal is to eventually be able to scan during market hours and find stocks that fit a specific set-up. For example, I would like a scan to be able to pick-up a stock that is within .5% of a gap that was created a month ago. Identifying the gap would be based off of historical data but knowing the gap is about to be breached would be based off of live data (correct? Do I have this right?).

 

#9

I am analyzing all stocks via the scanner (using my EL code) to identify stocks that fit a certain set-up (determined by EL code).

 

I may also use this code as an analysis technique on a specific chart.

 

Hope this made sense. Thanks again.

Share this post


Link to post
Share on other sites
Thanks Tams

 

#5: My goal is to eventually be able to scan during market hours and find stocks that fit a specific set-up. For example, I would like a scan to be able to pick-up a stock that is within .5% of a gap that was created a month ago. Identifying the gap would be based off of historical data but knowing the gap is about to be breached would be based off of live data (correct? Do I have this right?).

 

#9

I am analyzing all stocks via the scanner (using my EL code) to identify stocks that fit a certain set-up (determined by EL code).

 

I may also use this code as an analysis technique on a specific chart.

 

Hope this made sense. Thanks again.

 

 

you are NOT answering the questions.

 

have a nice day.

 

;-)

Edited by Tams

Share this post


Link to post
Share on other sites

It will take some considerable time and effort to learn EasyLanguage (EL) but it really is the easiest of the major trading program languages. The great thing about EL is the tremendous amount of educational material and support available. Also, just when you think you have learned everything, you discover a whole new level of complexity available.

 

Anyway, the best way to get started is the two courses sold by Tradestation. "The EasyLanguage Home Study Course" and "Mastering EasyLanguage for Strategies". A good companion while going through these two courses is "EasyLanguage Essentials" also sold by Tradestation.

 

Once you have a basic understanding of what is going on, the Tradestation WIKI is a great learning tool, and free.

 

There are also numerous books that include EL code to demonstrate concenpts from the books. A good one is "Building Winning Trading Systems with Tradestation" available from Amazon.

 

If you really want to create your own indicators, screens, and strategies it is going to take hundreds, perhaps thousands of hours of study and hard work to get far enough along to start doing cool stuff.

 

If you are not really that interested in programming, you would be better off to hire a Tradestation programmer to construct any indicator, screen or strategy you can imagine.

Share this post


Link to post
Share on other sites

"Last (Reserved Word) -

 

A quote field that returns a numeric expression representing the price of the last completed trade.

 

Note Quote fields do not reference history. In Chart Analysis, they will only plot a value from the current bar forward."

 

Why not try "Close" rather than "Last?"

Share this post


Link to post
Share on other sites

Last is the last traded price of the day. If you plot last on your chart then you will get a horizontal line at that price.

 

Close is the closing price of the bar. If you plot this you will get a line that goes up and down with each bar assuming the closing prices on bars are different as they normally are.

 

Charlton

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.