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

Sell Setups won't Plot in Indicator



PureBytes Links

Trading Reference Links

List:

I've been trying to work on the code in TS2000i Easy Language:

http://www.researchlabtrading.com/public/382.cfm

Would like to get it to plot like the way on a Bloomberg / CQG as
opposed to the attached example(s) which I did not code.

Inputs:
	COUNT(9), BARSBACK(4), COUNTDN(13), BARSCDN(2);
Vars:
	COUNTER(0), Z(0), LL(99999),
  	SELLSETUP(FALSE), INTERSECTION(FALSE), COUNTDOWN(0),
  	COUNTERB(0);

IF INTERSECTION = FALSE THEN
	COUNTDOWN = 0;

IF Close >= Close[BARSBACK] THEN
	COUNTER = COUNTER + 1
ELSE
	COUNTER = 0;

IF Close <= Close[BARSBACK] THEN
	COUNTERB = COUNTERB + 1
ELSE
	COUNTERB = 0;

IF COUNTERB = COUNT THEN
	SELLSETUP = FALSE;	{ Cancel Setup on BuySetup }

IF SELLSETUP AND
	COUNTER = COUNT THEN
		SELLSETUP = FALSE;	{ Recycle }

IF SELLSETUP = FALSE THEN BEGIN
	COUNTDOWN = 0;
  	INTERSECTION = FALSE;
  	LL = 99999;
	IF COUNTER = COUNT THEN BEGIN
		SELLSETUP = TRUE;
		FOR Z = 0 TO COUNT - 1 BEGIN
			IF Low[Z] < LL THEN
				LL = Low[Z];
	    END;
		FOR Z = 3 TO COUNT - 1 BEGIN
			IF Low <= High[Z] THEN
				INTERSECTION = TRUE;
				IF Z > 3 AND
					Low[1] <= High[Z] THEN
						INTERSECTION = TRUE;
						IF INTERSECTION THEN
							Z = COUNT - 1;
		END;
	END;
END;

IF SELLSETUP THEN BEGIN
  IF INTERSECTION = FALSE THEN BEGIN
    FOR Z = 3 TO COUNT - 1 BEGIN
      IF Low <= High[Z] THEN
	  	INTERSECTION = TRUE;
		IF INTERSECTION THEN
			Z = COUNT - 1;
	END;
END;

IF Close < LL THEN BEGIN
	SELLSETUP = FALSE;
	INTERSECTION = FALSE;
	COUNTER=0;
END;
END;

IF INTERSECTION THEN BEGIN
	IF Close > High[BARSCDN] THEN BEGIN
    	COUNTDOWN = COUNTDOWN + 1;
	    Value1 = Text_New(Date, Time, High, NumToStr(CountDown, 0));
		Text_SetColor(Value1, Red);
		PLOT3(High, "SEQSellCntDN");
	END;

IF INTERSECTION[1] = FALSE THEN Begin
  	PLOT4((High + Low) / 2, "Intersect");
 	Value2 = TL_New(Date[1], Time, (High + Low) / 2, Date, Time,
(High + Low) / 2);
		TL_SetColor(Value2, Red);
		TL_SetExtRight(Value2, True);
		If Value2 > 2 then				
			TL_SetExtRight(Value2[1], False);
END;
end;

IF COUNTDOWN = COUNTDN THEN BEGIN
	PLOT1(High,"Sequential");
	Value3 = TL_New(Date[1], Time, (High + Low) / 2, Date, Time,
(High + Low) / 2);
		TL_SetColor(Value3, Magenta);
		TL_SetExtRight(Value3, True);
		If Value3 > 2 then
			TL_SetExtRight(Value3[1], False);
	PLOT2((High + Low) / 2, "Sell");
  SELLSETUP = FALSE;
END;

Regards,

-- 
Thomas J. Festa, CMT

Phone: (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.

--