| Automated Trading Black box systems, strategy automation, algorithmic trading, etc... |
![]() | | Tweet | |
| | #1 | ||
![]() | Trying to Learn EasyLanguage, but Stuck 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. | ||
| |
|
| | #2 | ||
![]() | Re: Trying to Learn EasyLanguage, but Stuck 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. | ||
| |
|
| | #3 | ||
![]() | Re: Trying to Learn EasyLanguage, but Stuck 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. | ||
| |
|
| | #4 | ||
![]() | Re: Trying to Learn EasyLanguage, but Stuck 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 | ||
| |
|
| | #5 | ||
![]() | Re: Trying to Learn EasyLanguage, but Stuck HELLLLLOOOOOO... are you currently looking at LIVE data or HISTORIC data? Last edited by Tams; 08-17-2009 at 10:38 PM. | ||
| |
|
| | #6 | ||
![]() | Re: Trying to Learn EasyLanguage, but Stuck Variables: SMDot(0); SMDot = (high+low)*.50; | ||
| |
|
| | #7 | ||
![]() | Re: Trying to Learn EasyLanguage, but Stuck if Condition1 and Condition2 and Condition3 then begin FoundPattern=true; end else begin FoundPattern=false; end; to FoundPattern = Condition1 and Condition2 and Condition3; | ||
| |
|
| | #8 | ||
![]() | Re: Trying to Learn EasyLanguage, but Stuck 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 | ||
| |
|
![]() |
| Thread Tools | Search this Thread |
| 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 |