[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hard coding my stop just the way i like it.



PureBytes Links

Trading Reference Links

At 5:21 PM -0500 1/22/99, kathy t wrote:

>because im very new to this forum i thought i would plead for any
>suggestion on how to do this with EL without using TS 4.0's software
>money management system.


Attached is an example of how you can code stops and price targets in
EasyLanguage. Code and ELA file attached.

Bob Fulks



{ *******************************************************************

   System:       _Stop.Example

   Last Edit:    01/22/99

   Coded By:     Bob Fulks


********************************************************************}

Input:   Periods(14);

Vars:    SelPt(0), BuyPt(0),
         SStop(0), BStop(0),
         SelActive(FALSE), BuyActive(FALSE),
         STarget(0), BTarget(0),
         BuyCondition(FALSE), SelCondition(FALSE),
         MP(0) ;

MP = MarketPosition;

{Trivial buy/sell conditions as an example}
BuyCondition = Close crosses over  Average(Close, Periods);
SelCondition = Close crosses under Average(Close, Periods);

{Clear Active flags when filled}
if MP <> 0 or EntryDate(1) = Date then begin
   SelActive = FALSE;
   BuyActive = FALSE;
end;

{Set sell signal}
if SelCondition then begin
   SelPt = Low  - (6 points);
   SStop = High + (1 points);
   STarget = SelPt - MaxList(Range, 20 points);
   SelActive = TRUE;
   BuyActive = FALSE;
end;

{Set buy signal}
if BuyCondition then begin
   BuyPt = High + (6 points);
   BStop = Low  - (1 points);
   BTarget = BuyPt + MaxList(Range, 20 points);
   BuyActive = TRUE;
   SelActive = FALSE;
end;

if SelActive then Sell next bar at SelPt stop;
ExitShort("SExit") next bar at STarget limit;
ExitShort("SStop") next bar at SStop stop;

if BuyActive then Buy next bar at BuyPt stop;
ExitLong("LExit") next bar at BTarget limit;
ExitLong("LStop") next bar at BStop stop;

Attachment Converted: "c:\eudora\attach\STOP.ELA"