
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
pending order modify
Hey everyone, I tried to programm a price modify for pending orders. Its one of my first EAs. I want to write as many EAs so that I can write complex ones later on. With my order modify I have the problem that it is not working when I put it into a chart on my demo-account. Can anyone find mistakes and help me by correcting it? Thanks. I really have no more clues. Cheers
Hey Robert, thanks for ur help so far. How do I properly post code here? Thanks and cheers.
Hey Robert, thanks for ur help so far. How do I properly post code here? Thanks and cheers.
fabian103
You should do a simple copy and paste at that php code box
For some reason your code is "all over the place". Try it. If it does not work try attaching the part of the code you want to be revised as a separate file (using the attachment tool - the one pointed out at the picture)
Hi,
I've been trying to calculate the value of the bollinger bands inside the stochastic indicator but I haven't been able to do that.
I get the value referred to the pair, but I need the value that should be between 0 and 100.
Any pointer?
Thanks
Hi,
I've been trying to calculate the value of the bollinger bands inside the stochastic indicator but I haven't been able to do that.
I get the value referred to the pair, but I need the value that should be between 0 and 100.
Any pointer?
ThanksI assume that you mean calculating Bollinger bands of a stochastic (using stochastic values instead of symbols prices). You can not do that with a built in iBands() because it always uses main chart prices.
You could use iBandsOnArray() but with it you have an eternal metatrader problem : deviations can be only integer multipliplicators. You can not set deviations to fractional values. So, the best is to use iStdDevOnArray() and iMaOnArry() functions to calculate your own Bollinger bands of any value and with any width of the bands. In case of stochastic the code that does that would look like this :
for( i=limit; i>=0; i--)
{
double dev = iStdDevOnArray(stoch,0,BollingerPeriod,0,MODE_SMA,i);
bollmi = iMAOnArray(stoch,0,BollingerPeriod,0,MODE_SMA,i);
bollup = bollmi+BollingerDeviations*dev;
bolldn = bollmi-BollingerDeviations*dev;
}
Attaching the indicator itself too, so you can continue experimenting with it. It looks like this on the the chart :
____________________
PS: values of bands can exceed the 0 and 100 bounds (in cases when Stochastic is hovering around 0 or 100) depending on what bands multiplier you use for deviations and what is the length of the Bollinger bands calculation itself
I assume that you mean calculating Bollinger bands of a stochastic (using stochastic values instead of symbols prices). You can not do that with a built in iBands() because it always uses main chart prices.
You could use iBandsOnArray() but with it you have an eternal metatrader problem : deviations can be only integer multipliplicators. You can not set deviations to fractional values. So, the best is to use iStdDevOnArray() and iMaOnArry() functions to calculate your own Bollinger bands of any value and with any width of the bands. In case of stochastic the code that does that would look like this :
That is SUPER AWESOME!!!!!
Thanks very much, I have been trying for so long.
And thanks for the super fast reply.
One more stupi question.
The indi works very fine but I can't get the right number on the ea about the bands value.
For instance like in the pic you've attached the numbers 81...67..54....
That is SUPER AWESOME!!!!!
Thanks very much, I have been trying for so long.
And thanks for the super fast reply.
One more stupi question.
The indi works very fine but I can't get the right number on the ea about the bands value.
For instance like in the pic you've attached the numbers 81...67..54....Stochastic length on that example is set to 32. That is the only difference compared to default parameters
:):):) Stochastic length on that example is set to 32. That is the only difference compared to default parameters
Sorry..I didn't explain very well what I wanted to ask.
In my ea I am trying to get the number for example of upper or lower band in the stoch window like in the picture. For instance I want in the ea retrieve the upper band that is 81.8116 and I coded as
Comment(iCustom(NULL,0,"name",24,0,MODE_UPPER,0)); \\renamed the indi
but I don't have the right number.
Where am I wrong?
Thanks
Sorry..I didn't explain very well what I wanted to ask.
In my ea I am trying to get the number for example of upper or lower band in the stoch window like in the picture. For instance I want in the ea retrieve the upper band that is 81.8116 and I coded as
Comment(iCustom(NULL,0,"name",24,0,MODE_UPPER,0)); \\renamed the indi
but I don't have the right number.
Where am I wrong?
ThanksDo it like this :
The problem was that you can not put 0 in place of the slowing parameter since in that case metatrader will cause an error when calculating stochastic, and you will always get 0 as a return value, so use 1 instead (it is equivalent to no smoothing of the stochastic value). Also, better to use buffer numbers (MODE_MAIN is a reserved word in MQL - it 0 but in some cases they are not what you expect them to be). To get the rest of the values you would then have to write something similar to this :
[PHP]double middleBand = iCustom(NULL,0,"name",24,1,1,0);
double lowerBand = iCustom(NULL,0,"name",24,1,2,0);Ok...
Super thanks.
You saved me....