| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #9 | ||
![]() | Re: How to Do a Time Stop with Easylanguage Quote:
for code verifications, you have to do forward testing.
__________________ Only an idiot would reply to a stupid post Last edited by Tams; 07-13-2010 at 04:50 AM. | ||
| |
|
| | #10 | ||
![]() | Re: How to Do a Time Stop with Easylanguage Quote:
| ||
| |
|
| | #11 | ||
![]() | Re: How to Do a Time Stop with Easylanguage Quote:
Code:
{simple entry}
If marketposition=0 and C>O then buy this bar on close;
If marketposition=0 and C<O then sellshort this bar on close;
{exit}
var:
NumDays( 0 ),
NumHours( 0 ),
NumMinutes( 15 ) ;
variables:
RawDays( 0 ),
RawMinutes( 0 ),
ExtraDays( 0 ),
TotalMinutes( NumHours * 60 + NumMinutes ) ;
if MarketPosition = 1 then
begin
RawDays = DateToJulian( Date ) - DateToJulian( EntryDate ) ;
RawMinutes = TimeToMinutes( Time ) - TimeToMinutes( EntryTime ) ;
ExtraDays = RawDays - NumDays ;
if ExtraDays >= 0 and RawMinutes + ExtraDays * 1440 >= TotalMinutes then
Sell ( "Time Exit LX" ) next bar at market ;
end ;
if MarketPosition = -1 then
begin
RawDays = DateToJulian( Date ) - DateToJulian( EntryDate ) ;
RawMinutes = TimeToMinutes( Time ) - TimeToMinutes( EntryTime ) ;
ExtraDays = RawDays - NumDays ;
if ExtraDays >= 0 and RawMinutes + ExtraDays * 1440 >= TotalMinutes then
Buy To Cover ( "Time Exit SX" ) next bar at market ;
end ; | ||
| |
|
| | #12 | ||
![]() | Re: How to Do a Time Stop with Easylanguage I upgraded to TS 8.8 which separates the easylanguage editor into a separate application. BTW So far I'm not liking this "feature" because it takes 10 seconds to open it. But anyway, apparently the help file was split into two, one for easylanguage and one for tradestation non-easylanguage (before there was only one). So searching the TS help doesn't have anything for entryTime but inside the new TS IDE it does. Thanks! | ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Increasing Your Position Size Over Time | Dinerotrader | Money Management | 62 | 03-31-2012 03:54 PM |
| Pace of Tape - Measure Trade Intensity to Detect Reversals | cunparis | Trading Indicators | 37 | 09-03-2010 05:06 AM |
| NumericSeries and Arrays in Easylanguage | nsvv | Automated Trading | 10 | 07-13-2010 03:39 AM |
| Re: Best Times of Day to Trade the Futures? | tjnoon | Ultimate Trade Analyzer | 7 | 06-27-2010 06:02 PM |
| Easylanguage at What Price | trader273 | Coding Forum | 1 | 05-22-2010 11:23 PM |