Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 12-28-2008, 09:03 PM   #1

Join Date: Dec 2008
Location: Milwaukee
Posts: 16
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Help with Easy Language

I am working on a strategy for Open E cry. I have the beginning but I am having trouble writing my next step. I want it to say

"when price moves above moving average X sell second bar"

If you could help that would be great or send me a PM.

Thanks

Brian
BrianA is offline  
Reply With Quote
Old 12-29-2008, 09:05 AM   #2

Join Date: Jan 2008
Location: San Francisco
Posts: 394
Ignore this user

Thanks: 17
Thanked 338 Times in 156 Posts

Re: Help with Easy Language

<<"when price moves above moving average X sell second bar" >>

you have been vague but I will make some assumptions -- if you want it to sell the open of the second bar after the first CLOSE above the 20-period moving average:

value1=average(c,20);

if c>value1 then sell next bar at market;
Frank is offline  
Reply With Quote
Old 12-29-2008, 07:30 PM   #3

Join Date: Dec 2008
Location: Milwaukee
Posts: 16
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Help with Easy Language

Thanks!

I think I can make this work. If not do you mind a few more questions?

But I am hoping I can do it myself.

Brian
BrianA is offline  
Reply With Quote
Old 12-30-2008, 10:04 PM   #4

Join Date: Dec 2008
Location: Milwaukee
Posts: 16
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Help with Easy Language

What if I wanted to wait for the second bar above the moving average before I entered the trade? I have tried every way my limited ability allows, but no luck

Thanks

Brian
BrianA is offline  
Reply With Quote
Old 12-30-2008, 11:17 PM   #5

sep34's Avatar

Join Date: Dec 2008
Location: USA
Posts: 109
Ignore this user

Thanks: 17
Thanked 58 Times in 34 Posts

Re: Help with Easy Language

Try this..see if it works.

if c[1]>value1[1] and c>value1 then sell next bar at market;


Regards
sep34 is offline  
Reply With Quote
Old 12-31-2008, 10:06 AM   #6

Join Date: Dec 2008
Location: Milwaukee
Posts: 16
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Help with Easy Language

Thanks, but it seems to buy every bar after entry and sells them all when it crosses under. instead of just buying the entry and selling the exit?

I do really appreciate your help

Brian
BrianA is offline  
Reply With Quote
Old 12-31-2008, 11:13 AM   #7
sep344

Status: Guest
Posts: n/a
Ignore this user


Re: Help with Easy Language

Not sure what kind of exit strategy your using...
here is a chart with following startegy for entry and exits,, take a look. to me it looks like its working fine....but im also trading and did this real fast while trading, you need to check it to make sure.


---------------------
value1=AverageFC(c,20);


if c[1]>value1[1] and c>value1 then sell next bar at market;
if c[1]<value1[1] and c<value1 then buy next bar at market;

---------------------
Attached Thumbnails
Help with Easy Language-test123.jpg  
 
Reply With Quote
Old 12-31-2008, 11:21 AM   #8

sep34's Avatar

Join Date: Dec 2008
Location: USA
Posts: 109
Ignore this user

Thanks: 17
Thanked 58 Times in 34 Posts

Re: Help with Easy Language

Take a look at the following chart..looks good to me but idid this very fast...make sure to check it.
remember your exit strategy will change the strategy.


code
---------------------------------
value1=average(c,20);

if c[1]>value1[1] and c>value1 then sell next bar at market;
if c[1]<value1[1] and c<value1 then buy next bar at market;
---------------------------------

Regards..
Attached Thumbnails
Help with Easy Language-test.png  
sep34 is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of Easy Language Reserved Words trbates Beginners Forum 15 12-11-2009 11:44 AM
Easy Language Help JKLM Automated Trading 7 02-10-2009 11:17 PM
Easy Language in OEC, Help with Channel Indicator popstocks Coding Forum 10 11-07-2008 06:09 PM
Easy Language Strategy Help Marc33139 Automated Trading 3 07-28-2008 11:35 AM
Easy Language - Help with Simple System gatrader E-mini Futures Trading Laboratory 8 12-17-2007 06:40 PM

All times are GMT -4. The time now is 12:15 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.