Very Simple System

Scoot82

Newbie
Messages
3
Likes
0
Hi, I am new to Tradestation / EasyLanguage and am trying (unsuccessfully) to code a very simple system. All I want the system to do is the following (on an intraday basis):

Entry - If price goes up 1%, when compared to the day's opening price, then buy (only 1 buy signal per day though)
Exit - If price goes up 3%, when compared to entry price, then place a trailing stop sell or,
- if price goes down 2%, when compared to entry price, then sell at market or,
- if neither of the above happen, sell just before session close

If anyone could point me in the right direction or has done some similar coding, I would greatly appreciate it. I have been spinning my wheels for quite a while!
 
Any suggestion on what to search for? I've looked but haven't been able to find anything. Thanks
 
I've looked through the tradestation user forums and google searches - I'm learning easylanguage at the moment and am sure I will eventually figure it out on my own, but wanted a starting point to reference if possible.
 
I can help - how much have you coded up so far ?

You can either put it up here OR PM me & I'll show you where you are going wrong, this is very basic as far as ESL programming is concerned - but I'm not going to do all the work for you.

Teach a man to fish & all that ;)
 
This may or may not work, but either way it should get you close enough to finish the job on your own:

//The Entry
if time<sessionendtime(0,1) and EntriesToday(date)=0 then buy next bar opend(0)*1.01 stop;
//The Stop Loss
if marketposition=1 then sell next bar EntryPrice*0.98 stop;
//The Trailing Stop (You may wish to use SetDollarTrailing here instead.)
SetStopContract;
SetPercentTrailing(EntryPrice*0.03, 50{What percentage of profits do you want to give back?});
//The End of Day Exit
setexitonclose;
 
Top