Unfortunately metatrader does not work like tradestation, and for some reason metatrader people enabled that feature from the built in indicators and did not do the same thing for custom indicators
I tried what you said (really tried hard) but again failed
Can you please post here the full code with changes.
Little things that brings the joy back again :):)
Not sure if this has been done before or if anyone will have any use for this but I put together a simple extension of the Std-Dev indicator to allow you to calculate a simple MA of the Std-Dev. I use this to gauge when price is trending, if SD is greater than the moving average then price is in a trend and you should enter an order in the direction of the movement. seems to work best with high Std values, I currently use 50 period Std and 15 moving average period. It works well as a filter for my current EA, it managed to increase the accuracy by about 15%. Hope this helps someone.
Can spread and slippage be roughly estimated through standard deviation?
So slippage and spread increase in times of increased price fluctuation and news events. Can it be roughly estimated with regards to the standard deviation of past days or hours? For example. (S+S)=k*stdev(d1,d2,....dn) with k as a constant.
stdev formula help
I am have been trying to find out how to work out the Standard Deviation between the high and open of the previous bar.
Does anyone have some code to work this out.
any help would be great.
not sure what you are exactly asking here. In simple terms Standard Deviation is a way of saying how far typical values are from mean. In your case you just have High and Open of previous bar you can average these values cause otherwise doesn't seem to make sense. If you are referring to STDEV of MT4 that is something else and is based on MA
This is all part of a system I have a developed in excel.
In excel if you have a high of 2.5968 and a low of 2.5706 the average is 2.5837
But the stdev is 0.0185 I have been trying to create e script to emulat the same formula.
I hope this makes sense
To use high-low : use metatrader standard deviation indicator and in "Apply to" field use median price. Also use simple moving average in the "method" field (mean corresponds to simple moving average)
If it is not what you had in mind the simply change line 65 from this :
If you want a standard deviation of a difference of high and open, replace that line with this one :
I used the word average because with less data there is really no meaningful information we can use through STDEV . So mean or average is fine for the scenario i wrote before imho but in your case
To get std-dev we need to first get the variance which is another way of saying how the "data" is spread in other words the average of the distance of values from mean squared.. in your example using the same values we can write ( in a basic form ).
// mql4 code
double high = 2.5968;
double low = 2.5706;
double mean = (high+low)/2;
double variance = ((high-low)*(high-low))/2;
double stdev = MathSqrt(variance);
As you can see first we take the average or mean cause we need the middle value then we take the variance which is says how the data is spread across mean and then we take the stddev which says how "far"are the typical values from the mean.
-- hope this helps