1 registered members (monarch),
1,259
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Brokers incompatible with MT4 bridge?
[Re: jcl]
#458683
03/25/16 01:14
03/25/16 01:14
|
Joined: Apr 2014
Posts: 482 Sydney, Australia
boatman
OP
Senior Member
|
OP
Senior Member
Joined: Apr 2014
Posts: 482
Sydney, Australia
|
Well that explains a lot! I'm quite relieved that it turned out to be something so simple. So I can work around this in the mean time by doing something like:
function run() {
...
if (!is(LOOKBACK)) {
vars Ichi = series(Ichimoku(...));
}
...
}
Would you also mind checking the situation for the EMA indicator? I couldn't find its code in the indicators.c file. I am using the EMA indicator that uses a cutoff period rather than an alpha value. I would actually prefer to replace the EMA with a lowpass filter in my script, but it would still be useful to know if the EMA can handle non-existent prices too. Thanks again for your help with this.
|
|
|
Re: Brokers incompatible with MT4 bridge?
[Re: boatman]
#458684
03/25/16 02:05
03/25/16 02:05
|
Joined: Apr 2014
Posts: 482 Sydney, Australia
boatman
OP
Senior Member
|
OP
Senior Member
Joined: Apr 2014
Posts: 482
Sydney, Australia
|
Actually, the code I wrote above won't do at all. It won't calculate any indicator values for startup. Its no good just wrapping the 'plot' calls in an if(!is(LOOKBACK)) statement either since the problem is not a charting issue - the issue is that the incorrect indicator values are being used to trigger trades incorrectly. What about this for a simple workaround:
if (priceLow[0] < 0.5 * priceLow[1])
priceLow[0] = priceLow[1];
Not an ideal solution since some information is lost (the actual lowest price of the previous bar), but at least it would prevent drastic changes to the way the script trades. Any other ideas?
|
|
|
Re: Brokers incompatible with MT4 bridge?
[Re: jcl]
#458695
03/25/16 12:34
03/25/16 12:34
|
Joined: Apr 2014
Posts: 482 Sydney, Australia
boatman
OP
Senior Member
|
OP
Senior Member
Joined: Apr 2014
Posts: 482
Sydney, Australia
|
Here's an example of how an incorrect indicator value can trigger a trade:
function run() {
...
vars ihci = series(Ichimoku(tenkan, kijun, senku, offs));
vars senkuA = series(rSenkouA);
vars senkuB = series(rSenkouB);
if (priceClose[0] > senkuB[0]) enterLong();
}
In this case, if the value for senkuB[0] is incorrectly returned as zero, a trade will be triggered. This is precisely the behavior I am seeing. And my LookBack period is more than long enough. The problem is that Zorro registers an incorrect price, passes this price to an indicator value, and then triggers trades that would otherwise not be taken.
|
|
|
|