Coding help - page 562

 

Привет ! Помогите с индикатором ,не показывает peleng и выдает ошибки . Спасибо .

Files:
 
CaptureBeta:
Hi, Pls., check whether the attachment works fine for you. I modified the indicator code and checked it in my broker's (Alpari) trading platform. It does not show any errors after compilation. I have changed the name of the indicator (by adding a word 'new' within brackets) to avoid confusions.

Hi,

first of all thank you for your help....

please can you attach print screen of your input in order to see Pentagon on ,for example,1H chart of eurusd?

I don't know wich setting I must put on indicator window to see pentagon...I only see a lot of trendlines.....

Carbon

 
mladen:

Big Be

Will check it to see what is going on on my terminal

mladen,

How is this going?

It is really important for us. (Me and those who need my HeatMap.)

Big Be

 

Hi,

I'm new with mql4 and coding as a whole so can any of the experts please help me with the following two dilemas.

I need to add an arrow and alert when price breaches an MA from above, but it should repaint as when the price does not close below the MA to disappear again.

It draws the arrow and alert for candle 0 when it breaches, but the alert goes of for the whole time the bar is open.

How can I make it to only alert just when the arrow is drawn, and not with every tick.

I've tried the following.

if(i==1 && SoundAlert)Alert(_Symbol, _Period," Sell Alert"); or if(i==0 && SoundAlert)Alert(_Symbol, _Period," Sell Alert"); .... i = 0 in the for loop But keeps alerting with every tick. Then my second query: I'd also like to know as with example above, if price closes above an MA and stays there, but after x bars closes again below to give me an alert. What I'd like help with is how do I specify the x bars back when price closed again below the MA. I only want to look between 1-4 bars back that price was above the MA and then when the current bar closed below the MA should give ma an alert. Where do I start, what would I need to look at? I'm thinking the logic is something like follows: if((Close [i+1] && Close[i+2]&&Close[i+3]) > MA && Close <MA) but instead like this line with the RED, I need to be able to select in the input how many bars back to look and it should adjust this logic accordingly. ie.: if(Close[range selected]>MA && Close<A) Any help and direction is appreciated.

 
bokFX:
Hi,

I'm new with mql4 and coding as a whole so can any of the experts please help me with the following two dilemas.

I need to add an arrow and alert when price breaches an MA from above, but it should repaint as when the price does not close below the MA to disappear again.

It draws the arrow and alert for candle 0 when it breaches, but the alert goes of for the whole time the bar is open.

How can I make it to only alert just when the arrow is drawn, and not with every tick.

I've tried the following.

if(i==1 && SoundAlert)Alert(_Symbol, _Period," Sell Alert"); or if(i==0 && SoundAlert)Alert(_Symbol, _Period," Sell Alert"); .... i = 0 in the for loop But keeps alerting with every tick. Then my second query: I'd also like to know as with example above, if price closes above an MA and stays there, but after x bars closes again below to give me an alert. What I'd like help with is how do I specify the x bars back when price closed again below the MA. I only want to look between 1-4 bars back that price was above the MA and then when the current bar closed below the MA should give ma an alert. Where do I start, what would I need to look at? I'm thinking the logic is something like follows: if((Close [i+1] && Close[i+2]&&Close[i+3]) > MA && Close <MA) but instead like this line with the RED, I need to be able to select in the input how many bars back to look and it should adjust this logic accordingly. ie.: if(Close[range selected]>MA && Close<A) Any help and direction is appreciated.

Use something like this :

static datetime lastAlertedAt = 0;

if (Time[0]!=lastAlertedAt)

{

lastAlertedAt = Time[0];

...

the rest of alerting code

}

 

15-11-2015, 22:01

Привет! Помогите с индикатором, не показывает Пеленг и выдает ошибки. Спасибо. Вложения

 

Originally posted by mladen View Post

Big Be

Will check it to see what is going on on my terminal

Big Be:

mladen,

How is this going?

It is really important for us. (Me and those who need my HeatMap.)

Big Be

I couldn't leave it alone. With a lot of Comment statements, one at a time, and playing detective for hours, I figured out the source of the trouble.

There appears to be nothing wrong with the multidimensional arrays. I had set the array dimension to the number of pairs I was using. It needed to be the number of pairs and items the broker had available.The first setup I used (Metaquotes server) only had the 26 pairs. So it worked. But others have more. One has 285. The array must accommodate that.

NEW PROBLEM: what is the correct format for resizing a multidimensional array? I know you can only resize the first dimension. But when I use this the program just stops, whether I put it in start() or init() even though ArraySize gives the correct size after the resize :

ArrayResize(AlertsFoundII, size);

or

ArrayResize(AlertsFoundII, 285);

Big Be

 

I tried something, on a hunch. If I initialize the array with no first value like this: bool AlertsFoundII[][4][4]; and then resize the array later using the calculated value (variable), it works fine.

Big Be

 
Big Be:
Originally posted by mladen View Post

Big Be

Will check it to see what is going on on my terminal

I couldn't leave it alone. With a lot of Comment statements, one at a time, and playing detective for hours, I figured out the source of the trouble.

There appears to be nothing wrong with the multidimensional arrays. I had set the array dimension to the number of pairs I was using. It needed to be the number of pairs and items the broker had available.The first setup I used (Metaquotes server) only had the 26 pairs. So it worked. But others have more. One has 285. The array must accommodate that.

NEW PROBLEM: what is the correct format for resizing a multidimensional array? I know you can only resize the first dimension. But when I use this the program just stops, whether I put it in start() or init() even though ArraySize gives the correct size after the resize :

ArrayResize(AlertsFoundII, size);

or

ArrayResize(AlertsFoundII, 285);

Big Be

It must work using both ways (I am using 2 dimensional arrays that are dynamically resized all the time, and it works OK)

 
bokFX:
Hi,

I'm new with mql4 and coding as a whole so can any of the experts please help me with the following two dilemas.

I need to add an arrow and alert when price breaches an MA from above, but it should repaint as when the price does not close below the MA to disappear again.

It draws the arrow and alert for candle 0 when it breaches, but the alert goes of for the whole time the bar is open.

How can I make it to only alert just when the arrow is drawn, and not with every tick.

I've tried the following.

if(i==1 && SoundAlert)Alert(_Symbol, _Period," Sell Alert"); or if(i==0 && SoundAlert)Alert(_Symbol, _Period," Sell Alert"); .... i = 0 in the for loop But keeps alerting with every tick. Then my second query: I'd also like to know as with example above, if price closes above an MA and stays there, but after x bars closes again below to give me an alert. What I'd like help with is how do I specify the x bars back when price closed again below the MA. I only want to look between 1-4 bars back that price was above the MA and then when the current bar closed below the MA should give ma an alert. Where do I start, what would I need to look at? I'm thinking the logic is something like follows: if((Close [i+1] && Close[i+2]&&Close[i+3]) > MA && Close <MA) but instead like this line with the RED, I need to be able to select in the input how many bars back to look and it should adjust this logic accordingly. ie.: if(Close[range selected]>MA && Close<A) Any help and direction is appreciated.

Thanx for the info Mladen, will give it a try on the Alert.

I'd also like to know as with example above, if price closes above an MA and stays there, but after x bars closes again below to give me an alert. What I'd like help with is how do I specify the x bars back when price closed again below the MA. I only want to look between 1-4 bars back that price was above the MA and then when the current bar closed below the MA should give ma an alert. Where do I start, what would I need to look at? I'm thinking the logic is something like follows: if((Close [i+1] && Close[i+2]&&Close[i+3]) > MA && Close <MA) but instead like this line with the RED, I need to be able to select in the input how many bars back to look and it should adjust this logic accordingly. ie.: if(Close[range selected]>MA && Close<A) Any help and direction is appreciated.

Reason: