Welcome to the Traders Laboratory Forums.
Automated Trading Black box systems, strategy automation, algorithmic trading, etc...

Reply
Old 08-17-2009, 08:06 PM   #1

Join Date: Jun 2009
Location: Chicago
Posts: 35
Ignore this user

Thanks: 7
Thanked 18 Times in 11 Posts



Trying to Learn EasyLanguage, but Stuck

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.
Attached Thumbnails
Trying to Learn EasyLanguage, but Stuck-code.jpg   Trying to Learn EasyLanguage, but Stuck-algn.jpg   Trying to Learn EasyLanguage, but Stuck-aria.jpg  
jeffersondaarcy is offline  
Reply With Quote
Old 08-17-2009, 08:42 PM   #2

Tams's Avatar

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

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Trying to Learn EasyLanguage, but Stuck

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.



.

Last edited by Tams; 08-17-2009 at 09:04 PM.
Tams is offline  
Reply With Quote
Old 08-17-2009, 09:17 PM   #3

Tams's Avatar

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

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Trying to Learn EasyLanguage, but Stuck

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.


.

Last edited by Tams; 08-17-2009 at 09:29 PM.
Tams is offline  
Reply With Quote
Old 08-17-2009, 09:33 PM   #4

Join Date: Jun 2009
Location: Chicago
Posts: 35
Ignore this user

Thanks: 7
Thanked 18 Times in 11 Posts



Re: Trying to Learn EasyLanguage, but Stuck

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
Attached Thumbnails
Trying to Learn EasyLanguage, but Stuck-algn2.jpg  
jeffersondaarcy is offline  
Reply With Quote
Old 08-17-2009, 09:44 PM   #5

Tams's Avatar

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

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Trying to Learn EasyLanguage, but Stuck

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?

Last edited by Tams; 08-17-2009 at 10:38 PM.
Tams is offline  
Reply With Quote
Old 08-17-2009, 09:48 PM   #6

Tams's Avatar

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

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Trying to Learn EasyLanguage, but Stuck

try this:

Variables: SMDot(0);

SMDot = (high+low)*.50;

Tams is offline  
Reply With Quote
Old 08-17-2009, 10:11 PM   #7

Tams's Avatar

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

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Trying to Learn EasyLanguage, but Stuck

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;
Tams is offline  
Reply With Quote
Old 08-17-2009, 10:32 PM   #8

Join Date: Jun 2009
Location: Chicago
Posts: 35
Ignore this user

Thanks: 7
Thanked 18 Times in 11 Posts



Re: Trying to Learn EasyLanguage, but Stuck

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
Attached Thumbnails
Trying to Learn EasyLanguage, but Stuck-algn3.jpg  
jeffersondaarcy is offline  
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Much Would You Pay to Learn from a Veteran Trader? brownsfan019 Futures Trading Laboratory 40 03-30-2009 10:57 PM
Want to Learn to Read Bonds TraderBG Beginners Forum 5 09-29-2008 05:32 PM
Help Me to Learn to Trade Stocks!!! joshua Beginners Forum 9 05-02-2008 03:41 PM
What You Can Learn From The Opening Minutes Of Trading MrPaul Market Analysis 2 12-05-2006 06:49 PM
Anyone else get stuck in a trade today? Soultrader Futures Trading Laboratory 11 10-31-2006 10:11 AM

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