EA from scratch - Part 1 - page 4

 

That doesn't appear to be listed in the help file as a controlling compilation constant. Have you tried altering the code to your suggestion?

 

The high_low_plot_v0.3 produces unwanted effects. Coding it during periods where there is no live prices will show how the indicator should work but during live trading, the shapes are shown on the chart as the bar updates. This may at first appear to be very handy (and how I envisaged it) but the problem seems to be that this can lead to more than one shape being displayed against a bar as the bar updates possibly leaving more than one shape on the bar after it closes. Obviously the bar may go through several states before it closes so I understand why this is happening but it's not good in this instance as I expect that an EA will need to see the result only when the bar completes and as such the indicator should also behave in this manner. Lots of work to do then ...

 
Sadly:
That doesn't appear to be listed in the help file as a controlling compilation constant. Have you tried altering the code to your suggestion?

...I am reading "code guru's" lessons, and reviewing the lessons, right now I am up to "if...else" lesson then bouncing back to earlier lessons, then bouncing up...

...I am excited to absorbed c++, simply because I have great ideas for "ea" developing, thinking out of the box...

 

What you suggested will not work as there appears not to be such a preprocessor directive capable of colouring each bar although I must say that I do like your suggestion! Unfortunately for now, #property indicator bar_blue or #property indicator_bar_colour is wishful thinking ...

Never mind, we will press on and we will make an indicator and then an EA, right?

 
Sadly:
What you suggested will not work as there appears not to be such a preprocessor directive capable of colouring each bar although I must say that I do like your suggestion! Unfortunately for now, #property indicator bar_blue or #property indicator_bar_colour is wishful thinking ...

Never mind, we will press on and we will make an indicator and then an EA,

right?

...press on we will...

 

Thought not!

 
mycode:
...press on we will...

...counted_bars=IndicatorCounterRed();\

...does not compile...

 

Somehow we need to tell the program to draw a line of n size at point x on the chart. This will colour our bar. In our case, n = high - low and x = current low price. That's 2 arrays needed to draw the line

If only we could describe it in english! ie: Draw_buffer_array = Draw a line at Low[pos] from Low[pos] to High[pos] please

 

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(CLR_RED);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexBuffer(0,ExtMapBuffer2);

SetIndexBuffer(0,ExtMapBuffer3);

 

void SetIndexDrawBegin( int index, int begin)

Sets the bar number (from the data beginning) from which the drawing of the given indicator line must start. The indicators are drawn from left to right. The indicator array values that are to the left of the given bar will not be shown in the chart or in the DataWindow. 0 will be set as default, and all data will be drawn.

Having put this into the code, it appears to do absolutely naff all - groan