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

Using the H/L of entry bar as a stop?



PureBytes Links

Trading Reference Links

I would like to insert this code into another signal for TS2000i.

How do I do the following?:

<< { low = low of bar of entry, save as a variable }: >>

-- And set a StopLoss there?

Thomas

==========================================
Variable:	mp(0);	{ marketPosition }

{ initialize variable }
if currentBar = 1 then begin
   mp = 0;
end;

{ assign value to variable }
mp = marketPosition;

{ determines trade entry }
if mp<> 0 and barsSinceEntry = 0 then begin
   if mp = +1 then
      { you're long } ... { low = low of bar of entry, save as a variable }
   else if mp = -1 then
      { you're short };
end;
{ determines trade exit }
{ allows for multiple exits on the same bar }
for value1 = 2 downTo 1 begin
   if barsSinceExit(value1) = 0 then begin
      if marketPosition(value1) = +1 then
         { you exited a long position }
      else if marketPosition(value1) = -1 then
         { you exited a short position };
   end;
end;

{ for systems that trade on the close }
if mp<> 0 and barsSinceEntry = 1 then begin ...
   { low[1] = low of bar of entry, save as a variable }

=========================================================================

Thomas J. Festa, CMT
Technical Analysis Investment Consultant
Proprietary Trader, Equities
Benchmarq Trading, LLC  10003
Cell:   (908) 581-8880

Confidentiality Notice: The information contained in this e-mail and any
attachments may be legally privileged and confidential. If you are not an
intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this e-mail is strictly prohibited. If you have
received this e-mail in error, please notify the sender and permanently
delete the e-mail and any attachments immediately. You should not retain,
copy or use this e-mail or any attachment for any purpose, nor disclose all
or any part of the contents to any other person.