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

    • CVNA Carvana stock, nice top of range breakout at https://stockconsultant.com/?CVNA
    • GDRX GoodRx stock, good day, watch for a bottom range breakout at https://stockconsultant.com/?GDRX
    • Date: 14th February 2025.   Can The NASDAQ Maintain Momentum at Key Resistance Level?     The price of the NASDAQ throughout the week rose more than 3.00% to bring the price back up to the instrument’s resistance level. However, while taking into consideration higher inflation, tariffs and the resistance level, could the index maintain momentum?   US Inflation Rises For a 4th Consecutive Month The US Consumer Price Index, or inflation, rose for a 4th consecutive month taking the rate even further away from the Federal Reserve’s target. Analysts were expecting the US inflation rate to remain unchanged at 2.9%. However, consumer inflation rose to 3.00%, the highest since July 2024, while Producer inflation rose to 3.5%. Higher inflation traditionally triggers lower sentiment towards the stock market as investors' risk appetite falls and they prefer the US Dollar. However, on this occasion bullish volatility rose. For this reason, some traders may be considering if the price is overbought in the short term.   Addressing these statistics, US Federal Reserve Chair Jerome Powell acknowledged that the Fed has yet to achieve its goal of curbing inflation, adding further hawkish signals regarding the monetary policy. Other members of the FOMC also share this view. Today, Raphael Bostic, President of the Federal Reserve Bank of Atlanta, stated that the Fed is unlikely to implement interest rate cuts in the near future. This is due to ongoing economic uncertainty following the introduction of trade tariffs on imported goods and other policies from the Republican-led White House.   Most of the Federal Open Market Committee emphasizes additional time is needed to fully assess the situation. According to the Chicago Exchange FedWatch Tool, interest rate cuts may not start until September 2025.   What’s Driving The NASDAQ Higher? Earnings data this week has continued to support the NASDAQ. Early this morning Airbnb made public their quarterly earnings report whereby they beat both earnings per share and revenue expectations. The Earnings Per Share read 25% higher than expectations and Revenue was more than 2% higher. As a result, the stock rose more than 14%. Another company this week that made public positive earnings data is Cisco which rose by more than 2% on Thursday. Another positive factor continues to be the positive employment data. Even though the positive employment data can push back interest rate cuts, the stability in the short term continues to serve the interests of higher consumer demand. The US Unemployment Rate fell to 4.00% the lowest in 8 months. Lastly, investors are also increasing their exposure to the index due to sellers not being able to maintain control or momentum. Some economists also increase their confidence in economic growth if Trump can obtain a positive outcome from the Ukraine-Russia negotiations.   However, during Friday’s pre-US session trading, 80% of the most influential stocks are witnessing a decline. The NASDAQ itself is trading more or less unchanged. Therefore, the question again arises as to whether the NASDAQ can maintain momentum above this area.   NASDAQ - News and Technical analysis In terms of technical analysis, the NASDAQ is largely witnessing mainly bullish indications on the 2-hour chart. However, the main concern for traders is the resistance level at $21,960. On the 5-minute timeframe, the price is mainly experiencing bearish signals as the price moves below the 200-period simple moving average.   The VIX, which is largely used as a risk indicator, is currently trading 0.75% higher which indicates a lower risk appetite. In addition to this, bond yields trade 6 points higher. If both the VIX and Bond yields rise further, further pressure may be witnessed for index traders.   Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report.   Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news.   Michalis Efthymiou HFMarkets   Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in Leveraged Products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • LUNR Intuitive Machines stock watch, attempting to move higher off 18.64 support, target 26 area at https://stockconsultant.com/?LUNR
    • CNXC Concentrix stock watch, pullback to 47.16 triple support area with bullish indicators at https://stockconsultant.com/?CNXC
×
×
  • Create New...

Important Information

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