Requests & Ideas - page 253

 
Hermo:
Hello,

I did a simple EA to show me the current spread. The EA just has :

.....

int start()

{

Comment("Spread: " + DoubleToStr(Ask - Bid, Digits));

return(0);

}

.....

The result is the photo I've attached. How can be possible the difference of the spread between daily data and my script? Is it something wrong in my script or in the indicator?

Also, I would like know how can I get a fix spread on my backtests. I get 99% of quality, but the spread is always the same of the market (I mean, the same spread of real one on the pair of my backtesting).

Thank you aqnd sorry for my english.

Hermo

Hermo

There is nothing wrong with your script

In the daily data indicator spread is retrieved from MarketInfo() function and not as difference between bid and ask. That value should be updated by the broker, and as you can see, broker does not update that value with each and every tick (that spread is actually a spread that should be if the spread was fixed)

As of backtesting : metatrader will use simulated spreads and not real spreads. It does not keep values of bid and ask in any form whatsoever so it can not reconstruct historical spreads

 

Good evening everyone!

Sorry for my english.

Thank you for the last response. I got it.

I need a modification on this indicator. Could you add a mid-band?

I try to draw it on the indicator with a whit line to help to understand.

Thank you.

A big hug.

Hermo

 
Hermo:
Good evening everyone!

Sorry for my english.

Thank you for the last response. I got it.

I need a modification on this indicator. Could you add a mid-band?

I try to draw it on the indicator with a whit line to help to understand.

Thank you.

A big hug.

Hermo

Hermo

Here you go

 

Thanks... All I can say is this forum is great.

 
rayphua:
Mladen, whenever you're ready with the push alert additions for the 3 indicators. Happy veteran's day.

rayphua

Here is this one. It will alert when the alignment direction (trend) changes

 
mladen:
rayphua Here is this one. It will alert when the alignment direction (trend) changes

Mladen, thank you. I checked the code, it seems that there are 2 conditions; all values aligned or, or down, but the 3rd condition where all values are neither up nor down is missing. Are you able to fit the 3rd condition in as well?

 
rayphua:
Mladen, thank you. I checked the code, it seems that there are 2 conditions; all values aligned or, or down, but the 3rd condition where all values are neither up nor down is missing. Are you able to fit the 3rd condition in as well?

rayphua

There is no such condition that all are neither up or neither down. If not all are up or not all are down, it is considered to be neutral. Anyway, here is one version that will alert on neutral too, but be prepared that there will be times when you are going to get a lot of alerts when the state of some is changing from neutral to some other state. Not going to replace the one at the original post simply for that case - to keep the previous version without those multiple alerts on the same bar

 
mladen:
rayphua There is no such condition that all are neither up or neither down. If not all are up or not all are down, it is considered to be neutral. Anyway, here is one version that will alert on neutral too, but be prepared that there will be times when you are going to get a lot of alerts when the state of some is changing from neutral to some other state. Not going to replace the one at the original post simply for that case - to keep the previous version without those multiple alerts on the same bar

Mladen, can you check if there is an error with this when using targettimeframeprice set to True... im getting alerts for up and down even though it clearly is down on the chart.

Further, when alerts are set to off, and alerts notify to off, i still get push alerts to my mobile.

 
rayphua:
Mladen, can you check if there is an error with this when using targettimeframeprice set to True... im getting alerts for up and down even though it clearly is down on the chart. Further, when alerts are set to off, and alerts notify to off, i still get push alerts to my mobile.

rayphua

In my tests it is working OK. You are going to get multiple alerts when you change time frames or symbols, since the indicator is checking each bar in that case, but as far as I see when you leave it work it works OK

 
mladen:
rayphua In my tests it is working OK. You are going to get multiple alerts when you change time frames or symbols, since the indicator is checking each bar in that case, but as far as I see when you leave it work it works OK

Mladen, since the turn of the 4 hr bar is coming in a few minutes, I'll leave it to see if it works ok, and will update you in a few minutes.

As for turning off the alerts and push notifications, that does not seem to work, it still alerts when it's set to off.

Reason: