Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,486 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 6 of 7 1 2 3 4 5 6 7
Re: Brokers incompatible with MT4 bridge? [Re: boatman] #458663
03/24/16 07:05
03/24/16 07:05
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The general problem with those indicators is that they normally retun 0 when accessing nonexisting data, as is the case during the lookback period. This is sometimes tricky to work around, since it is unknown what they shall return instead.

Maybe this is not properly solved for the Ichimoku. I'll check.

Update: It is indeed so. The Ichimoku has no precautions against returning zero due to nonexisting data. This will be fixed in the next update, but inbetween you can simply solve it by plotting the Ichimoku only when the lookback period is over.


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
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

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:

Code:
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
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

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:
Code:
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: boatman] #458686
03/25/16 09:22
03/25/16 09:22
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
How can incorrect indicator values trigger trades? You must make sure with a sufficient lookback period that only valid indicator values trigger trades in your script.

I understood the issue as a chart problem, not a problem that affects the trading behavior. PriceLow is not supposed to be fixed. It's the indicator that is wrong, not PriceLow.

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
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
Here's an example of how an incorrect indicator value can trigger a trade:

Code:
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.

Re: Brokers incompatible with MT4 bridge? [Re: boatman] #458697
03/25/16 13:11
03/25/16 13:11
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Hmm. I see no incorrect trade in your code. Zorro does not trade in the lookback period. When did that happen? Do you have a log of how Zorro registers an incorrect price and triggers a wrong trade?

Re: Brokers incompatible with MT4 bridge? [Re: jcl] #458700
03/25/16 14:03
03/25/16 14:03
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
That's my point - there is nothing wrong with the code. The problem is that Zorro was registering a price that never existed and that incorrect price was used to calculate the value of my indicators. The resulting incorrect indicator caused trades to be taken when they shouldn't have.

This is the very issue that I initially contacted support about. I've also stated a number of times in this thread that the detection of non-existent prices is causing incorrect indicator calculations.


Another way of explaining this is that if the price that Zorro registers is not the correct price (for example, the wild ticks in the charts shown throughout the thread), then any indicator that uses that price in its input will also not be correct.

I have the log file from when the issue first came up back on March 15, but I wasn't printing indicator values to the log file, so it is probably not much use.

I have been running the same script with printfs for some hours today and tonight, and so far I haven't seen it occur again. If/when it does happen, I will post the log file.

Re: Brokers incompatible with MT4 bridge? [Re: boatman] #458704
03/25/16 18:03
03/25/16 18:03
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Ok. Support does not know anything about this new problem, nor do I. If you see it happening, please save the log and post it here, or contact Support. They'll look into it, so we can determine what the problem is. We already have your script.

Re: Brokers incompatible with MT4 bridge? [Re: jcl] #458712
03/26/16 00:36
03/26/16 00:36
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
There's obviously been some miscommunication (and I accept some responsibility for that) - this is not a new problem; its the same problem that I initially contacted support about. I guess it is just framed slightly differently: in terms of an incorrect indicator calculation rather than a problem with the MT4 bridge (which I assumed to be the root cause).

In any event, I haven't been able to reproduce the error from post #458662. I ran my script on 10 assets up until the Friday close and it never occurred once.

If it happens again, I'll be sure to post the log.

Re: Brokers incompatible with MT4 bridge? [Re: boatman] #458713
03/26/16 00:43
03/26/16 00:43
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
For the record, and so that we are all on the same page, here is my initial email to support. It clearly mentions the incorrect indicator calculations:

Hello

I'm a Zorro S user (invoice number XXXXXXX) and I'm hoping to get some help.

Is it possible for the MT4 platforms of individual brokers to be incompatible with the Zorro MT4 bridge?

I am asking because I have found that when connected to a certain broker in live trading mode, Zorro detects obviously erroneous ticks. I can find no trace of these erroneous ticks in the MT4 chart, nor in the MT4 history centre. No trades have so far been executed at or close to these levels, which makes me question whether these ticks actually existed. Is it possible that the Zorro bridge could somehow register a tick that never existed?

Although no trades have been executed at these erroneous tick levels, my system uses the recent high and recent low by way of the HH() and LL() functions. These erroneous ticks have a significant impact on the values calculated by these functions (verified by printing indicator values to the log file) and several trades have been executed as a result, when they clearly shouldn't have.

This issue first came to my attention last night on EUR/USD. Attached is the image that Zorro created - although the quality is not great (I am running my VPS using 15-bit color to free up as much RAM as possible) you can see the erroneous ticks occurring between 7 and 8 PM at values of approximately 2.3 and 1.7. These ticks dwarf the scale and therefore the rest of the price curve is barely visible. Clearly EUR/USD never traded at these levels and there is no sign of these ticks in the broker's MT4 feed.

Page 6 of 7 1 2 3 4 5 6 7

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1