NexusFi: Find Your Edge


Home Menu

 





EasyLanguage Programmers! I need your HELP!


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one sixhundread with 8 posts (0 thanks)
    2. looks_two artisanpro with 5 posts (2 thanks)
    3. looks_3 ShadowFox with 4 posts (5 thanks)
    4. looks_4 SunTrader with 1 posts (2 thanks)
      Best Posters
    1. looks_one SunTrader with 2 thanks per post
    2. looks_two AlgOz with 2 thanks per post
    3. looks_3 ShadowFox with 1.3 thanks per post
    4. looks_4 artisanpro with 0.4 thanks per post
    1. trending_up 6,150 views
    2. thumb_up 11 thanks given
    3. group 6 followers
    1. forum 19 posts
    2. attach_file 4 attachments




 
Search this Thread

EasyLanguage Programmers! I need your HELP!

  #1 (permalink)
sixhundread
Vienna and Austria
 
Posts: 36 since Jul 2021
Thanks Given: 21
Thanks Received: 7

I am new to EasyLanguage and I tried my best, but I cant get it done by now.

The code should be a strategy witch uses the Elder Impulse System.

input length = 13;
input paintBars = yes;

def EMA = ExpAverage(close, length);
def MACD = ExpAverage(close, 12) - ExpAverage(close, 26);
def MACDHist = MACD - ExpAverage(MACD, 9);
def GreenPrice = EMA > EMA[1] and MACDHist > MACDHist[1];
def RedPrice = EMA < EMA[1] and MACDHist < MACDHist[1];

plot Bullish = GreenPrice;
plot Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;

Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.hide();
Neutral.SetDefaultColor(Color.BLUE);
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.hide();

DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.BLUE);
DefineGlobalColor("Bearish", Color.DOWNTICK);
AssignPriceColor(if !paintBars then Color.CURRENT else if GreenPrice then globalColor("Bullish") else if RedPrice then globalColor("Bearish") else globalColor("Neutral"));

Please help!

Thanks and best wishes for your weekend!

600

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Deepmoney LLM
Elite Quantitative GenAI/LLM
Are there any eval firms that allow you to sink to your …
Traders Hideout
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Futures True Range Report
The Elite Circle
 
  #2 (permalink)
artisanpro
montreal, qc, canada
 
Posts: 28 since May 2021
Thanks Given: 28
Thanks Received: 18

I do not recognize this as EasyLanguage code. In addition, a strategy / signal in EasyLanguage has code to do: buy, sell, etc.

It is obvious to me that you haven't spent much time on this before posting on this forum. I would suggest that you do some basic research. A 4 second search i.e. typing, gave me this link: https://www.multicharts.com/discussion/viewtopic.php?t=2679

Do some cut and paste, compile and start fixing any compilation errors (if any).

Reply With Quote
Thanked by:
  #3 (permalink)
SunTrader
Boca Raton, FL
 
Posts: 260 since Nov 2018
Thanks Given: 81
Thanks Received: 182


I was going to post the same - as well as mentioning that this is a custom job and there are plenty of 3rd party EL specialists (found also searching) that can do this ... for a price.

Reply With Quote
Thanked by:
  #4 (permalink)
 
AlgOz's Avatar
 AlgOz 
Sydney, Australia
 
Experience: Beginner
Platform: TradeStation, MultiCharts
Broker: TradeStation
Trading: Futures, stocks
Posts: 7 since Jun 2021
Thanks Given: 4
Thanks Received: 4

Hey 600,

Like our other forum fellas said, it seems your code still need a bit a rework. It does not look like a EL coding as is. Usually EL codes need to have the following structure and common statements:

Inputs: inputname(defaultvalue);
Variables: variablename(intialvalue);
Arrays: arrayname[arraysize](intialvalue);
If <true/false expression> then begin <EL statement> end;
Plot1(numericvalue);
Alert(alert string);
Buy next bar at Market;
Sell Short next bar at Market;
For <variablename> = 1 to <num> then begin <EL statement> end;
Print(expression list);
Commentary(expression list);

Etc. It also uses specific wording called "reserve words" in the code to start and/or finish statements, like variables assignment statements, comments and other.

Have a look at the two EL docs attached in case you had not see them before so you can a better idea of the structure, type of statement and language (reserved words) you can use.

On EL Essentials go to page 93 to check the basic strategy code structure outlined their as an example.

Also. try to get more info from the following websites:
https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=112042
https://www.tradestation.com:443/promo/easylanguage-boot-camp/?_ga=2.245519751.289150193.1625277676-1032257533.1612590524
Obs.: you may need to open or have an account with TradeStation to access these websites.

You can also get good information and access to webinars and other training materials at: https://www.youcantrade.com. You can sign up for free and get access to some of their EL material for a limited time or subscribe for $99/mo.

Hope that helps.

Attached Files
Elite Membership required to download: EasyLanguage - Functions and Reserved Words.pdf
Elite Membership required to download: EasyLanguage-Essentials.pdf
Reply With Quote
Thanked by:
  #5 (permalink)
 
ShadowFox's Avatar
 ShadowFox 
CO/USA
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks, Futures
Posts: 129 since Jun 2020
Thanks Given: 70
Thanks Received: 157

I don't speak .net but it looks fairly easy to see what this is trying to do. An EMA, MACD and MACDHist variable with bullish and bearish conditions. Its a paintbar indicator. I threw this together in 2 minutes. I do suggest you learn easylanguage though if you want to build on this or test other ideas.

 
Code
inputs:
length(13);

vars:
MyEMA(0),
MyMACD(0),
MACDHist(0);

MyEMA = XAverage(close,length);
MyMACD = XAverage(close,12) - XAverage(close,26);
MACDHist = MyMACD - XAverage(MyMACD,9);

Value1 = High;
Value2 = Low;

if MyEMA > MyEMA[1] and MACDHist > MACDHist[1] then begin
PlotPaintBar( Value1, Value2, "Plot", Cyan ) ;
end else if MyEMA < MyEMA[1] and MACDHist < MACDHist[1] then begin
PlotPaintBar( Value1, Value2, "Plot", Magenta ) ;
end ;

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #6 (permalink)
sixhundread
Vienna and Austria
 
Posts: 36 since Jul 2021
Thanks Given: 21
Thanks Received: 7


ShadowFox View Post
I don't speak .net but it looks fairly easy to see what this is trying to do. An EMA, MACD and MACDHist variable with bullish and bearish conditions. Its a paintbar indicator. I threw this together in 2 minutes. I do suggest you learn easylanguage though if you want to build on this or test other ideas.

 
Code
inputs:
length(13);

vars:
MyEMA(0),
MyMACD(0),
MACDHist(0);

MyEMA = XAverage(close,length);
MyMACD = XAverage(close,12) - XAverage(close,26);
MACDHist = MyMACD - XAverage(MyMACD,9);

Value1 = High;
Value2 = Low;

if MyEMA > MyEMA[1] and MACDHist > MACDHist[1] then begin
PlotPaintBar( Value1, Value2, "Plot", Cyan ) ;
end else if MyEMA < MyEMA[1] and MACDHist < MACDHist[1] then begin
PlotPaintBar( Value1, Value2, "Plot", Magenta ) ;
end ;

thanks for that!

i got a paintbar of this before, I need an indicator witch i can add to a list, to get a alert.

Reply With Quote
  #7 (permalink)
 
ShadowFox's Avatar
 ShadowFox 
CO/USA
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks, Futures
Posts: 129 since Jun 2020
Thanks Given: 70
Thanks Received: 157


sixhundread View Post
thanks for that!

i got a paintbar of this before, I need an indicator witch i can add to a list, to get a alert.

Just add the following code for alerts in the if statements

Alert("Bullish");

So it would be like this. Just enable alerts for the study. Currently it would alert at every bar. If you only want it to alert when it goes from bullish to bearish or neutral to directional you could record the direction in a variable then change it in the if statement. I highly suggest you spend some time trying to digest what is going on here and it won't take too long for you to make some simple additions.

 
Code
inputs:
length(13);

vars:
MyEMA(0),
MyMACD(0),
MACDHist(0);

MyEMA = XAverage(close,length);
MyMACD = XAverage(close,12) - XAverage(close,26);
MACDHist = MyMACD - XAverage(MyMACD,9);

Value1 = High;
Value2 = Low;

if MyEMA > MyEMA[1] and MACDHist > MACDHist[1] then begin
PlotPaintBar( Value1, Value2, "Plot", Cyan ) ;
Alert("Bullish");
end else if MyEMA < MyEMA[1] and MACDHist < MACDHist[1] then begin
PlotPaintBar( Value1, Value2, "Plot", Magenta ) ;
Alert("Bearish");
end ;

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #8 (permalink)
sixhundread
Vienna and Austria
 
Posts: 36 since Jul 2021
Thanks Given: 21
Thanks Received: 7


ShadowFox View Post
Just add the following code for alerts in the if statements

Alert("Bullish");

So it would be like this. Just enable alerts for the study. Currently it would alert at every bar. If you only want it to alert when it goes from bullish to bearish or neutral to directional you could record the direction in a variable then change it in the if statement. I highly suggest you spend some time trying to digest what is going on here and it won't take too long for you to make some simple additions.

 
Code
inputs:
length(13);

vars:
MyEMA(0),
MyMACD(0),
MACDHist(0);

MyEMA = XAverage(close,length);
MyMACD = XAverage(close,12) - XAverage(close,26);
MACDHist = MyMACD - XAverage(MyMACD,9);

Value1 = High;
Value2 = Low;

if MyEMA > MyEMA[1] and MACDHist > MACDHist[1] then begin
PlotPaintBar( Value1, Value2, "Plot", Cyan ) ;
Alert("Bullish");
end else if MyEMA < MyEMA[1] and MACDHist < MACDHist[1] then begin
PlotPaintBar( Value1, Value2, "Plot", Magenta ) ;
Alert("Bearish");
end ;



thank you a lot SHADOWFOX!


thank you for teaching me, its really easy!

Reply With Quote
  #9 (permalink)
sixhundread
Vienna and Austria
 
Posts: 36 since Jul 2021
Thanks Given: 21
Thanks Received: 7


ShadowFox View Post
Just add the following code for alerts in the if statements

Alert("Bullish");

So it would be like this. Just enable alerts for the study. Currently it would alert at every bar. If you only want it to alert when it goes from bullish to bearish or neutral to directional you could record the direction in a variable then change it in the if statement. I highly suggest you spend some time trying to digest what is going on here and it won't take too long for you to make some simple additions.

 
Code
inputs:
length(13);

vars:
MyEMA(0),
MyMACD(0),
MACDHist(0);

MyEMA = XAverage(close,length);
MyMACD = XAverage(close,12) - XAverage(close,26);
MACDHist = MyMACD - XAverage(MyMACD,9);

Value1 = High;
Value2 = Low;

if MyEMA > MyEMA[1] and MACDHist > MACDHist[1] then begin
PlotPaintBar( Value1, Value2, "Plot", Cyan ) ;
Alert("Bullish");
end else if MyEMA < MyEMA[1] and MACDHist < MACDHist[1] then begin
PlotPaintBar( Value1, Value2, "Plot", Magenta ) ;
Alert("Bearish");
end ;

i tried to make a strategy out of it, is it correct?



inputs:
length(13);

vars:
MyEMA(0),
MyMACD(0),
MACDHist(0);

MyEMA = XAverage(close,length);
MyMACD = XAverage(close,12) - XAverage(close,26);
MACDHist = MyMACD - XAverage(MyMACD,9);

Value1 = High;
Value2 = Low;

if marketPosition = 0 and MyEMA > MyEMA[1] and MACDHist > MACDHist[1] Then
Buy next bar at Open;


if marketposition = 1 and MyEMA < MyEMA[1] and MACDHist < MACDHist[1] then
Sell next bar at Open;

if Marketposition = 0 and MyEMA < MyEMA[1] and MACDHist < MACDHist[1] then
Sellshort next bar at open;

if Marketposition = -1 and MyEMA < MyEMA[1] and MACDHist < MACDHist[1] then
Buy to Cover next bar at Open;

Reply With Quote
  #10 (permalink)
artisanpro
montreal, qc, canada
 
Posts: 28 since May 2021
Thanks Given: 28
Thanks Received: 18


Yes, it is correct - it compiles and makes money as seen on the attachment showing the last 500 days of USDCAD

NOTE: see caveat on next post

USDCAD 500 days 2021-07-19_1523

Attached Thumbnails
Click image for larger version

Name:	USDCAD 500 days  2021-07-19_1523.jpg
Views:	160
Size:	367.7 KB
ID:	315196  
Reply With Quote




Last Updated on September 2, 2021


© 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