Moving Average changing slope for all symbols Alert - could you help ? - page 3

 
phy:

Calculate and compare slope, not angle.

slope is a rate, in this case pips per bar.



HI Phy,

With this method will the slope change when the scaling of the charts does?

Thanks

 

"With this method will the slope change when the scaling of the charts does?"

Define "scaling"

scaling == zoom in/out -- no

scaling == change timeframe - depends...

if slope == change in price per unit or units of time defined as a number of bars --- then yes

if slope == change in price per unit or units of specified time --- then no

 
8284:
I didnt put the full code here because I have many things Im doing at once but there is a way to prevent the older object from being overwritten. see here ObjectSet(object_id1,OBJPROP_XDISTANCE,(i*20)+20); This way you can move the x location every 20 pixels ( using obj_label) How you do this depends on how you want the indicator to look

Hi 8284 !!

I have been reading on the previous posts, and you look like to be skilful on the MT4 programming and referring issues (and off course much more than I do ;-)

My concern is the following and may be you can help me :

I would like my price alert indicator to work in multiple profiles.

To explain a bit further, I am using a Price Alert Indicator (see file attached) and it works perfectly in one single profile. However, I have created various profiles on my MT4 platform, and the indicator does not alert me when the price reaches the set level, just because I have another active profile at that moment.

As an example, I have two profiles : one with EURUSD and another in GBPUSD.

I set the alert to inform me when the EURUSD achieves 1.4082. Suddenly I place an order in the GBPUSD and therefore I change the profile to follow the GBPUSD.

Meanwhile EURUSD reaches the 1.4082. However, I am not informed by the alert price indicator as I have the GBPUSD profile in activity.

It is only when I come back to the initial profile (EURUSD) that the alert indicator shall inform me that the set price has been reached, but at that time the EURUSD is 1.4155. It means that it is very late to place an order, and the price alert did not work as I wanted.

Therefore, what I have tried to do was to modify the price alert indicator in order to make it work in all profiles at the same time. As I did not succeed in that, I thought that may be you can give a hand on that..

I know that MT4 has as a price indicator in its default settings which works in any profile, but to be honest, I like better this custom indicator, which is easier to set and more graphic.

Furthermore, please note that in my example I am saying that I have two profiles. The reality is that I have around 15 !. Therefore, is would be very tedious to attach to every profile the indicator at every time (Same problem I have with another indicator which is a moving average crossing by the way..)

I trust your knowledge, and I hope you could save me days exploring how to modify the attached indicator in order to obtain the desired result

Thanks a lot and wait for your answer!!

Cheers,

PFX

Files:
 
if (MarketInfo("EURUSD",MODE_ASK) > 1.4082)
   {
   Alert("Price above the alert level.");
   PlaySound("alert.wav");
   SendMail("Price for " + "EURUSD" +  " above the alert level " + MarketInfo("EURUSD",MODE_ASK), "Price for " + "EURUSD" +  " reached " + MarketInfo("EURUSD",MODE_ASK) + " level, which is above your alert level of "
   + SoundWhenPriceGoesAbove);
   }
Reason: