Easylanguage code problem

This is a discussion on Easylanguage code problem within the Trading Software forums, part of the Commercial category; Dears traders, Example long When sma60> sma90 and sma60> sma150 and sma90> sma150 we will take as maximum reference the ...

Reply
 
LinkBack Thread Tools Search this Thread
Old Aug 31, 2017, 4:42pm   #1
 
1 Posts
Joined Aug 2017
Easylanguage code problem

Dears traders,


Example long

When sma60> sma90 and sma60> sma150 and sma90> sma150 we will take as maximum reference the maximum of the 30 bars before the cross.

If then this maximum will be broken upwards we will have long signal.


I have verified that it does not respect the maximum constraint of the 30 candles before the cross up.

What's wrong with the formula ??


thank you.

All help graciously received and appreciated.


luca

in simple terms:

When the averages cross up, the cross is the condition that if it is true we will have buy signal at the top when it is exceeds the previous 30 candles crossing.


code:


Input: average(c), len(60), len1(90),len2(150);


condition1= len>len1 and len>len2 and len1>len2 ;

condition2=len<len1 and len<len2 and len1<len2;


condition3=H crosses over Highest(h,30);

condition4=L crosses under Lowest(l,30);


if condition1 and condition3 then buy next bar at market;

if condition2 and condition4 then sellshort next bar at market;

Last edited by ponex; Aug 31, 2017 at 6:46pm.
ponex is offline   Reply With Quote
Old Sep 2, 2017, 11:13am   #2
Joined Jan 2006
Check out www.markeplex.com and www.systemtradersuccess.com.

They are both websites with a huge amount of free content on EL coding.
I've been using those sites in the past few weeks and they have been very helpful.

Additionally search for TradeStation EasyLanguage material on YouTube.

I am sure you will find your answer quickly.

Good luck.
__________________
Check out my FX trading blog - updated 5-8 times a month - entertaining and educational!

And for a honest look into trading, check out my T2W member profile (published Dec2015)
options-george is offline   Reply With Quote
Old Sep 2, 2017, 5:32pm   #3
Joined May 2003
Quote:
Originally Posted by ponex View Post
Dears traders,


Example long

When sma60> sma90 and sma60> sma150 and sma90> sma150 we will take as maximum reference the maximum of the 30 bars before the cross.

If then this maximum will be broken upwards we will have long signal.


I have verified that it does not respect the maximum constraint of the 30 candles before the cross up.

What's wrong with the formula ??


thank you.

All help graciously received and appreciated.


luca

in simple terms:

When the averages cross up, the cross is the condition that if it is true we will have buy signal at the top when it is exceeds the previous 30 candles crossing.


code:


Input: average(c), len(60), len1(90),len2(150);


condition1= len>len1 and len>len2 and len1>len2 ;

condition2=len<len1 and len<len2 and len1<len2;


condition3=H crosses over Highest(h,30);

condition4=L crosses under Lowest(l,30);


if condition1 and condition3 then buy next bar at market;

if condition2 and condition4 then sellshort next bar at market;

what are sma60, sma90 and sma150? Where are you calculating these? If they are sma values, you need to calculate these. Currently you are just declaring lengths and comparing these and these comparisons are always going to be true.

I assume you want something like the following (not tested):

Input: len(60), len1(90),len2(150);
Variables: sma60(0), sma90(0), sma150(0);


sma60 = average(close, len);
sma90 = average(close, len1);
sma150 = average(close, len2);

condition1= sma60>sma90 and sma90>sma150 and sma60>sma150;
condition2= sma60<sma90 and sma90<sma150 and sma60<sma150;


condition3=H crosses over Highest(h,30);

condition4=L crosses under Lowest(l,30);


if condition1 and condition3 then buy next bar at market;

if condition2 and condition4 then sellshort next bar at market;

Last edited by iq200; Sep 2, 2017 at 5:38pm.
iq200 is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help in converting Metastock code to Tradestation easylanguage mircovento Trading Software 0 Feb 24, 2012 7:33pm
EasyLanguage Code Question surfcat88 First Steps 3 Dec 14, 2011 11:21am
Jim Hyerczyk (Easylanguage code) Collingwood First Steps 0 Nov 11, 2011 7:28am
Need help in converting Metastock code to Tradestation easylanguage amar_gr Trading Software 1 May 6, 2009 3:46pm
Easylanguage code help intradaybill Trading Software 6 Feb 26, 2008 12:57am

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)