NexusFi: Find Your Edge


Home Menu

 





"Wrong Expression"


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,516 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

"Wrong Expression"

  #1 (permalink)
 deltastrike 
California
 
Experience: Intermediate
Platform: Multicharts
Trading: Futures
Posts: 6 since Mar 2012
Thanks Given: 5
Thanks Received: 0

Hello master EL programmers...I've been dove into EL head first without a programming background and I'm trying to troubleshoot this code that I came across for a simple pattern signal. When I attempt to compile it it give me an error saying "wrong expression" and highlights the first "NumericSimple" input argument. I have no idea why this is wrong, it even looks identical to the example provided in the editor dictionary.

{#function C_3WhSolds_3BlkCrows}

Inputs:
Length(NumericSimple),
Percent(NumericSimple),
o3WhiteSoldiers( numericref ),
o3BlackCrows( numericref ) ;

variables:
BodyHi( 0 ),
BodyLo( 0 ),
Body( 0 ),
BodyAvg( 0 ),
UpShadow( 0 ),
DnShadow( 0 ),
MyRange( 0 ),
Factor( Percent * .01 ) ;

BodyHi = MaxList( Close, Open ) ;
BodyLo = MinList( Close, Open ) ;
Body = BodyHi - BodyLo ;
BodyAvg = XAverage( Body, Length ) ;
UpShadow = High - BodyHi ;
DnShadow = BodyLo - Low ;
MyRange = High - Low ;

o3WhiteSoldiers = 0 ;
o3BlackCrows = 0 ;

if CurrentBar > 2
and Body > BodyAvg
and Body[1] > BodyAvg[1]
and Body[2] > BodyAvg[2]
{ THREE CONSECUTIVE LONG BODIES }
then
begin
if Close > Open
and Close[1] > Open[1]
and Close[2] > Open[2]
{ ALL THREE BODIES WHITE... }
and Close > Close[1]
and Close[1] > Close[2]
{ ...EACH WITH A HIGHER CLOSE }
and Open < Close[1] and Open > Open[1]
and Open[1] < Close[2] and Open[1] > Open[2]
{ EACH OPEN WITHIN PREVIOUS BODY... }
and UpShadow / MyRange < Factor
and UpShadow[1] / MyRange[1] < Factor
and UpShadow[2] / MyRange[2] < Factor
{ ...AND EACH CLOSE NEAR HIGH }
then
o3WhiteSoldiers = 1
else if Close < Open
and Close[1] < Open[1]
and Close[2] < Open[2]
{ ALL THREE BODIES BLACK... }
and Close < Close[1]
and Close[1] < Close[2]
{ ...EACH WITH A LOWER CLOSE }
and Open > Close[1] and Open < Open[1]
and Open[1] > Close[2] and Open[1] < Open[2]
{ EACH OPEN WITHIN PREVIOUS BODY... }
and DnShadow / MyRange < Factor
and DnShadow[1] / MyRange[1] < Factor
and DnShadow[2] / MyRange[2] < Factor
{ ...AND EACH CLOSE NEAR LOW }
then
o3BlackCrows = 1 ;
end ;


Any help would be appreciated!

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
REcommedations for programming help
Sierra Chart
NexusFi Journal Challenge - May 2024
Feedback and Announcements
How to apply profiles
Traders Hideout
Quant vue
Trading Reviews and Vendors
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
77 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
37 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
17 thanks
  #3 (permalink)
 
Hulk's Avatar
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
Posts: 369 since May 2014
Thanks Given: 731
Thanks Received: 901



deltastrike View Post
Hello master EL programmers...I've been dove into EL head first without a programming background and I'm trying to troubleshoot this code that I came across for a simple pattern signal. When I attempt to compile it it give me an error saying "wrong expression" and highlights the first "NumericSimple" input argument. I have no idea why this is wrong, it even looks identical to the example provided in the editor dictionary.

...

Any help would be appreciated!

Just taking a shot here... Did you copy and paste this to create a new "Indicator" or a new "Function"? I am willing to bet that you mistakenly created an indicator instead of a function. The input types NumericSimple, NumericSeries etc are reserved words for functions and will fail to compile when used in anything other than a function.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 deltastrike 
California
 
Experience: Intermediate
Platform: Multicharts
Trading: Futures
Posts: 6 since Mar 2012
Thanks Given: 5
Thanks Received: 0


Hulk View Post
Just taking a shot here... Did you copy and paste this to create a new "Indicator" or a new "Function"? I am willing to bet that you mistakenly created an indicator instead of a function. The input types NumericSimple, NumericSeries etc are reserved words for functions and will fail to compile when used in anything other than a function.

Thanks!

Started this thread Reply With Quote




Last Updated on March 4, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts