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

Buy/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), HH(0),
	BUYSETUP(FALSE), INTERSECTION(FALSE), COUNTDOWN(0),
	COUNTERS(0);

IF INTERSECTION = FALSE THEN
	COUNTDOWN = 0;

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

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

IF COUNTERS = COUNT THEN
	BUYSETUP = FALSE;	{ Cancel Setup on SellSetup }

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

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

IF BUYSETUP THEN BEGIN
  IF INTERSECTION = FALSE THEN BEGIN
    FOR Z = 3 TO COUNT - 1 BEGIN
      IF High >= Low[Z] THEN
	  	INTERSECTION = TRUE;
      	IF INTERSECTION THEN
	  		Z = COUNT - 1;
    END;
END;
	IF  Close > HH THEN BEGIN
		BUYSETUP = FALSE;
	    INTERSECTION = FALSE;
    	COUNTER=0;
	  END;
  END;

IF INTERSECTION THEN BEGIN
  IF Close < Low[BARSCDN] THEN BEGIN
    COUNTDOWN = COUNTDOWN + 1;
    Value1 = Text_New(Date, Time, Low, NumToStr(CountDown, 0));
	Text_SetColor(Value1, Green);
	PLOT3(Low, "SEQBuyCntDN");
  END;

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

IF COUNTDOWN = COUNTDN THEN BEGIN
	PLOT1((High + Low) / 2, "Sequential");
	Value3 = TL_New(Date[1], Time, (High + Low) / 2, Date, Time,
(High + Low) / 2);
		TL_SetColor(Value3, Cyan);
		TL_SetExtRight(Value3, True);
		If Value3 > 2 then
			TL_SetExtRight(Value1[1], False);
			PLOT2(Low, "Buy");
			BUYSETUP = 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.

--