Coding help - page 463

 
mrcodix:
Hello,

ArrayMaximum - MQL4 Documentation

I've looked it up and it seems that this function returns the highest value of all the values in the array. What I am looking for is a function that tells you the highest value an indicator reached within one timeframe bar. How can i record this? So for example indicator X is forming the most recent bar. It goes from 3 to 5 to 4 to 7 and then when the time frame bar closes it finishes at value 2. The highest value it reached was 7. How can i record this value?

There is no function that will do that automatically for you

Do simply something like this :

int count = 0;

int hftbar = iBarShift(NULL,HigherTimeFrame,Time);

for (int k = 0; (i+k)<(Bars-1); k++)

if (iBarShift(NULL,HigherTimeFrame,Time)==hftbar)

count++;

else break;

(the assumption is that you are using variable i in your main loop)

After this executes, count variable will have the exact number of bars that you have to searcg for hihjest high or lowest low and that are still belonging to the higher time frame bars

 
mladen:
There is no function that will do that automatically for you

Do simply something like this :

int count = 0;

int hftbar = iBarShift(NULL,HigherTimeFrame,Time);

for (int k = 0; (i+k)<(Bars-1); k++)

if (iBarShift(NULL,HigherTimeFrame,Time)==hftbar)

count++;

else break;

(the assumption is that you are using variable i in your main loop)

After this executes, count variable will have the exact number of bars that you have to searcg for hihjest high or lowest low and that are still belonging to the higher time frame bars

Hi,

What do you mean with HigherTimeFrame?

 
mrcodix:
Hi, What do you mean with HigherTimeFrame?

You called it "one timeframe bar." .

If it is the current time frame, then the highest and the lowest are simply the values of the current bar.

Only in case that you are looking for bars belonging to a higher time frame bar, it makes sense to seek that (for example, you are on a 15 minute chart, and you would like to see what is the minimum or maximum of 15 minute indicator values reached so far for the current day)

 

Hi Mladen, wanted to ask her if it is possible to modify this indicator doing in way of transforming the straight lines of this indicator in soft lines as the moving average. in practice this indicator works as that indicative that I had asked him if you/he/she could be programmed with the MA upset, I hope both possible to do this

non_repainting_supertrend_alerts.mq4[ATTACH]

 
morenokosta:
Hi Mladen, wanted to ask her if it is possible to modify this indicator doing in way of transforming the straight lines of this indicator in soft lines as the moving average. in practice this indicator works as that indicative that I had asked him if you/he/she could be programmed with the MA upset, I hope both possible to do this

non_repainting_supertrend_alerts.mq4[ATTACH]

morenokosta

It can not be done since the super trend trends depend directly on those values. Changing those values would render super trend indicator more or less useless

 
mladen:
morenokosta It can not be done since the super trend trends depend directly on those values. Changing those values would render super trend indicator more or less useless

Not it is all right from there one.... thanks however for your availability

 
morenokosta:
Not it is all right from there one.... thanks however for your availability

morenokosta

The "trend" of the super trend depends on the values we are seein on the chart too. If those values are changed, the super trend "trend" is changed - and it will not be the same any more - it will be showing trends on all the different places compared to the original super trend

 

Hi there!

I don't know if you could help but it would be great!

I'm trying to figure the conditions for my EA. But I'm falling into some sort of problem when coding with the bollinger bands.

How can I tell the EA that I want the trade to be taken if the wholecandle's body goes over the bollinger : this means boths sides of candle.

For the moment, I have condition :

Close[0]>bands(0,0)+Above_Below_Range*P*Point

Sadly, it takes the trade when like this :

I want it to take the trade when the whole body is out like this :

Any solution?

Thanks

Files:
 

Hello

I found this indi and modified it to suit my needs.

Please tell me if/how I can put an input box to open the charts for all the currency pairs that contain CAD for example.

If not, an input box for me to load one pair into then open the charts.

Thank-you for your time,

Darren

string template_ = "DCC";

//

void OnStart()

{

//

long nr;

nr = ChartOpen(Symbol(),1440);

ChartApplyTemplate(nr,template_);

nr = ChartOpen(Symbol(),240);

ChartApplyTemplate(nr,template_);

nr = ChartOpen(Symbol(),60);

ChartApplyTemplate(nr,template_);

nr = ChartOpen(Symbol(),15);

ChartApplyTemplate(nr,template_);

nr = ChartOpen(Symbol(),5);

ChartApplyTemplate(nr,template_);

//

}

 
DCC66:
Hello

I found this indi and modified it to suit my needs.

Please tell me if/how I can put an input box to open the charts for all the currency pairs that contain CAD for example.

If not, an input box for me to load one pair into then open the charts.

Thank-you for your time,

Darren

string template_ = "DCC";

//

void OnStart()

{

//

long nr;

nr = ChartOpen(Symbol(),1440);

ChartApplyTemplate(nr,template_);

nr = ChartOpen(Symbol(),240);

ChartApplyTemplate(nr,template_);

nr = ChartOpen(Symbol(),60);

ChartApplyTemplate(nr,template_);

nr = ChartOpen(Symbol(),15);

ChartApplyTemplate(nr,template_);

nr = ChartOpen(Symbol(),5);

ChartApplyTemplate(nr,template_);

//

}

You first need to check what symbols containing "CAD" in the name

You can use code from this indicator for that : https://www.mql5.com/en/forum/173060/page118

Reason: