Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
You placed the the location update inside the check that is only executed once to draw the trendline. Also compare the start and end point used for drawing the trendline with what you are using for the location update.
As I understand it, ABCTG means that you shouldn't put the location update in the code block that's only executed once (i.e., when `alreadyPlotted` is false). That probably makes sense when you think about it.
If you want to update the trend line on the close of each bar (for example), you can do as follows:
But if I make a suggestion Kidvic, perhaps it's wise to rethink what you're actually want to make. Because the code we're helping you now with has little to do with your question that started this thread.
Jura, the HighestALL function was resolved when you suggested the tl_new and extensions to left, and right. The example you saw was so you can see what I mean when I meant a HORIZONTAL line. (the condition was an example that created the horizontal line)
This last script you posted worked perfect alone, however when I introduced it to my script I ran into a few problems.
I think the best way to go about it now is to maybe actually call a barNumber. I have tried but I failed.
I have used the MaxBarsBack function, but I think I might be using it wrong. Also, I see a function called LastBarOnChart, but as I'm a noob programmer, I might be interpreting the syntax wrong.
I thought I might use (LastBarOnChart - 3) but that doesn't seem to work either.
I continue to try different ways, but It doesn't seem to work.
This last script you posted worked perfect alone, however when I introduced it to my script I ran into a few problems.
I think the best way to go about it now is to maybe actually call a barNumber. I have tried but I failed.
I have used the MaxBarsBack function, but I think I might be using it wrong. Also, I see a function called LastBarOnChart, but as I'm a noob programmer, I might be interpreting the syntax wrong.
I thought I might use (LastBarOnChart - 3) but that doesn't seem to work either.
I continue to try different ways, but It doesn't seem to work.
Can you clarify what you're trying to achieve now? It's not very clear to me, sorry. Why would you like the use the bar number for example?
Can you clarify what you're trying to achieve now? It's not very clear to me, sorry. Why would you like the use the bar number for example?
Because as I've introduced the Above code into my script And it's really really slow. Also removing the trendline to the left does not remove it. Using current bar Plots a trend line on that bar.
Because as I've introduced the Above code into my script And it's really really slow. Also removing the trendline to the left does not remove it. Using current bar Plots a trend line on that bar.
Could you post the code that you are using now? Then we can take a look at it. If it's proprietary, can you create a code example that replicates this problematic behaviour?
Could you post the code that you are using now? Then we can take a look at it. If it's proprietary, can you create a code example that replicates this problematic behaviour?
Var: TL_ID(-1);
if (CurrentBar = 10)
then begin
TL_ID = TL_New(Date, Time, High, Date, Time, Low);
end;
if (CurrentBar = 11)
then begin
TL_SetEnd(TL_ID, Date, Time, Low);
end;
Currentbar draws at bar 10 from left to right, how about from right to left?
Var: TL_ID(-1);
if (CurrentBar = 10)
then begin
TL_ID = TL_New(Date, Time, High, Date, Time, Low);
end;
if (CurrentBar = 11)
then begin
TL_SetEnd(TL_ID, Date, Time, Low);
end;
Currentbar draws at bar 10 from left to right, how about from right to left?
Can you expand more on what the trend line drawn from right to left needs to do? Is that right-to-left trend line still drawn on the same bars and price coordinates? Or should that line be drawn on future, yet to form price bars? If so, how should that trend line be updated; extended further into the future or remain in place?
Btw, your current code draws a trend line on historical data and then extends it once on the next bar. Is that what you want it to do? I'm asking because this is something else than I understood from your previous posts in this thread, so there might be a misunderstanding here.
PS: a screenshot with your goal will probably speak more than words.