How do I delete buffer arrows at end of zero bar?

 

Hello forum, I am not quite sure of the right wording for this question.

I have made an indicator that draws arrows on my chart during the current (0) bar for certain conditions.

This is what I want it to do. But I am wondering if it is possible to remove the arrows at the end of that bar.

I only want the arrow or arrows to show during the current bar and then disappear when the new (0) bar is formed.

The information I obtain from the arrows during the zero bar is of know use to me when looking back in time and in fact may confuse future analysis.

To achieve this, I assume it needs a certain form of deinit(), but I am not sure how to limit this to just the zero bar, and reference specific objects (perhaps I refer to all objects ??)

The documentation is very lean to say the least on this topic

I think someone ran a deinit() on this topic :-)

If there is a good explanation of this topic, I would love to read it as well as specifically getting advice on the specific scenario above

thanks in advance as always!

 
pullend:

Hello forum, I am not quite sure of the right wording for this question.

I have made an indicator that draws arrows on my chart during the current (0) bar for certain conditions.

This is what I want it to do. But I am wondering if it is possible to remove the arrows at the end of that bar.

I only want the arrow or arrows to show during the current bar and then disappear when the new (0) bar is formed.

The information I obtain from the arrows during the zero bar is of know use to me when looking back in time and in fact may confuse future analysis.

To achieve this, I assume it needs a certain form of deinit(), but I am not sure how to limit this to just the zero bar, and reference specific objects (perhaps I refer to all objects ??)

The documentation is very lean to say the least on this topic

I think someone ran a deinit() on this topic :-)

If there is a good explanation of this topic, I would love to read it as well as specifically getting advice on the specific scenario above

thanks in advance as always!




make buffer[1] and higher   empty value or  no value  give only buffer[0] its value for drawing arrow
 
deVries:

make buffer[1] and higher   empty value or  no value  give only buffer[0] its value for drawing arrow

Is that as simple as changing the [] tp [0] as below, where in this BUffer1 is the buffer I don't want showing after the zero bar?

Awesome solution if it is that simple, thank you!

double              Buffer1[];               //-- Long  Trade Arrows

to

double              Buffer1[0];               //-- Long  Trade Arrows
 
pullend:

Is that as simple as changing the [] tp [0] as below, where in this BUffer1 is the buffer I don't want showing after the zero bar?

Awesome solution if it is that simple, thank you!

to


Thinking about it, changing the double value to calculate only the zero buffer, may not stop that value being kept?

Not sure if the arrow will be deleted t end of zero bar.

Will fix my code and check.

 
pullend:

Thinking about it, changing the double value to calculate only the zero buffer, may not stop that value being kept?

Not sure if the arrow will be deleted t end of zero bar.

Will fix my code and check.

At the start of each new bar set  buffer[1] to EMPTY_VALUE

buffer[1]  is the value in the buffer for bar 1,   buffer[0] is the value in the buffer for bar 0 

 
pullend:

Is that as simple as changing the [] tp [0] as below, where in this BUffer1 is the buffer I don't want showing after the zero bar?

Awesome solution if it is that simple, thank you!

double              Buffer1[];               //-- Long  Trade Arrows

to

double              Buffer1[0];               //-- Long  Trade Arrows

Buffers are automatically sized. Buffer1[0] is a zero length buffer. You can NOT do that.

They did NOT tell you to set the buffer to zero length, they said to SET the values IN THE BUFFER to EMPTY_VALUE

Didn't specify an Empty Value
int start(){
   ArrayInitialize(Buffer1, EMPTY_VALUE);
   :
   Buffer1[0] = yourArrow;
Did specify. E.g. 0.0
int init(){
   SetIndexEmptyValue(0, 0.0);
   :
}
int start(){
   ArrayInitialize(Buffer1, 0.0);
   :
   Buffer1[0] = yourArrow;
Reason: