sorry for my English writing ... but I wanted to know if you can stop a trendline after an input. I tried to write the following code but it does not work. How can you do?
if(MarketPosition= -1) then begin
if BarsSinceEntry=1 then
tl_setend(tlUP,date[0],time[0],entryprice);
end;
Regards
Mauro
End tl after entry .. is possible ?
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
You have to describe your problem in more detail.sorry for my English writing ... but I wanted to know if you can stop a trendline after an input. I tried to write the following code but it does not work. How can you do?
if(MarketPosition= -1) then begin
if BarsSinceEntry=1 then
tl_setend(tlUP,date[0],time[0],entryprice);
end;
Regards
Mauro
What do you mean by "...but it does not work"?
At the minimum, you have to draw a diagram to illustrate what you want to do,
and what is the stumbling block?
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
ok .. thanks TJ .. let me explain better ....in attached, I send an image of the chart and explanations of what I would do.
That is, end the trendline after making an entrance Long or Short.
The code I wrote is:
...but it does not work, in the sense that even after making an 'entry, the trendline is not terminated.
Is it possible do it?
Regards
Mauro
That is, end the trendline after making an entrance Long or Short.
The code I wrote is:
Code: Select all
if(MarketPosition= -1) then begin
if BarsSinceEntry=1 then
tl_setend(tlUP,date[0],time[0],entryprice);
end;
Is it possible do it?
Regards
Mauro
- Attachments
-
- CutTrendLine.JPG
- (67.6 KiB) Downloaded 389 times
- JoshM
- Posts: 2196
- Joined: May 20 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
If the trend line should also be extended after making a new enter long trade, checking for just `MarketPosition = -1` is not sufficient (since that will only check for short).That is, end the trendline after making an entrance Long or Short.
The code I wrote is:Code: Select all
if(MarketPosition= -1) then begin
if BarsSinceEntry=1 then
tl_setend(tlUP,date[0],time[0],entryprice);
end;
I would adjust the above code snippet to:
Code: Select all
if (MarketPosition(0) <> 0) and (BarsSinceEntry(1) = 1) then begin
TL_SetEnd(tlUP, Date[0], Time[0], EntryPrice(1));
end;