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.


  • Topics

  • Posts

    • Why not to simply connect you account to myfxbook which will collect all this data automatically for you? The process you described looks tedious and a bit obsolete but may work for you though.
    • The big breakthrough with AI right now is “natural language computing.”   Meaning, you can speak in natural language to a computer and it can go through huge data sets, make sense out of them, and speak back to you in natural language.   That alone is a huge breakthrough.   The next leg? AI agents. Where they don’t just speak back to you.   They take action. Here’s the definition I like best: an AI agent is an autonomous system that uses tools, memory, and context to accomplish goals that require multiple steps.   Everything from simple tasks (analyzing web traffic) to more complex goals (building executive briefings or optimizing websites).   They can:   > Reason across multiple steps.   >Use tools like a real assistant (Excel spreadsheets, budgeting apps, search engines, etc.)   > Remember things.   And AI agents are not islands. They talk to other agents.   They can collaborate. Specialized agents that excel at narrow tasks can communicate and amplify one another’s strengths—whether it’s reasoning, data processing, or real-time monitoring.   What it Looks Like You wake up one morning, drink your coffee, and tell your AI agent, “I need to save $500 a month.”   It gets to work.   First, it finds all your recurring subscriptions. Turns out you’re paying $8.99 for a streaming service you forgot you had.   It cancels it. Then it calls your internet provider, negotiates a lower bill, and saves you another $40. Finally, it finds you car insurance that’s $200 cheaper per year.   What used to take you hours—digging through statements, talking to customer service reps on hold for an hour, comparing plans—is done while you’re scrolling Twitter.   Another example: one agent tracks your home maintenance needs and gets information from a local weather-monitoring agent. Result: "Rain forecast next week - should we schedule gutter cleaning now?"   Another: an AI agent will plan your vacations (“Book me a week in Italy for under $2,000”), find the cheapest flights, and sort out hotels with a view.   It’ll remind you to pay bills, schedule doctor’s appointments, and track expenses so you’re not wondering where your paycheck went every month.   The old world gave you tools—Excel spreadsheets, search engines, budgeting apps. The new world gives you agents who do the work for you.   Don’t Get Too Scared (or Excited) Yet William Gibson famously said: "The future is already here – it's just not evenly distributed."   AI agents will distribute it. For decades, the tools that billionaires and corporations used to get ahead—personal assistants, financial advisors, lawyers—were out of reach for regular people.   AI agents could change that.   BUT, remember…   We’re in inning one.   AI agents have a ways to go.   They’re imperfect. They mess up. They need more defenses to get ready for prime time.   To be sure, AI is powerful, but it’s not a miracle worker. It’s great at helping humans solve problems, but it’s not going to replace all jobs overnight.   Instead of fearing AI, think of it as a tool to A.] save you time on boring stuff and B.] amplify what you’re already good at. Right now is the BEST time to start experimenting. It’s also the best time to find investments that will “make AI work for you”. Author: Chris Campbell (AltucherConfidential)   Profits from free accurate cryptos signals: https://www.predictmag.com/     
    • What a wild year.   AI seems to be appearing everywhere you look, Paris hosted a weird Olympics, unrest continues in the Middle East, the US endured a crazy-heated election, and the largest rocket ever to fly successfully landed in a giant pair of robot arms.   Okay, but what about the $money stuff?   Well, this year we've seen a load of uncertainty - inflation is still biting and many businesses have gone down.   Property has been very fractured, with developments becoming prohibitively expensive, while other markets have boomed.   It hasn't been an easy ride, that's for sure.   However, the stock market has had some outstanding results, and for those who know how to trade, some have done VERY well for themselves.   Some have replaced their incomes. Some have set themselves up for the rest of their days on this planet.   How about you? How did you go? Author: Louise Bedford    Profits from free accurate cryptos signals: https://www.predictmag.com/  
    • U Unity Software stock watch, attempting to move higher off the 22.4 triple+ support area at https://stockconsultant.com/?U  
    • TSSI TSS stock, watch for an ascending triangle breakout above 11.49, target 15 area at https://stockconsultant.com/?TSSI
×
×
  • Create New...

Important Information

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