Creating or modifying trendline cause MC to hang
Posted: Aug 22 2011
Hello
First time that I play with trendline code. My goal is to found and modify and if not found create a trendline to display a proposed entry and stop loss.
First, I want to know if a trendline with 2 characteristic do exist
I want to have 4 combinaison to descrimate them
A)Green for Long entry
B)Red for Short entry
c) long Dot "- - - - -": for entry
d) Short dot for Stop loss: For stop loss
For the existence of a long orders price parameters, the following function will look for:
TL_Getcolor(TlNum) = 65280 ( green)
TL_GetStyle(TlNum) = 2
Any help appreciated
Martin
First time that I play with trendline code. My goal is to found and modify and if not found create a trendline to display a proposed entry and stop loss.
First, I want to know if a trendline with 2 characteristic do exist
I want to have 4 combinaison to descrimate them
A)Green for Long entry
B)Red for Short entry
c) long Dot "- - - - -": for entry
d) Short dot for Stop loss: For stop loss
For the existence of a long orders price parameters, the following function will look for:
TL_Getcolor(TlNum) = 65280 ( green)
TL_GetStyle(TlNum) = 2
Code: Select all
Input:
TLColor (NumericSimple),
TLStyle (NumericSimple);
var:
TLNum (0),
TLFound (False);
TLNum = 1;
while (tlnum <> -2) or (tlfound = false) or (tlnum < 100) begin
print(TlNum);
If Tl_Getcolor(TlNum) = TLColor and TL_GetStyle(TLNum) = TLStyle then TLFound = True;
Print (TL_Getcolor(tlNum):0:0, " " , tlnum:0:0);
TLnum=TLNum + 1;
end;
If tlnum = 100 then tlnum = 0;
TlExist = Tlnum;
Martin