Gamestudio Links
Zorro Links
Newest Posts
New Zorro version 2.30
by Zheka. 08/03/20 15:24
script CurrencyStrength
by jcl. 08/03/20 14:01
Moving Panels together
by Aku_Aku. 08/03/20 12:22
Why gamestudio USE Lite_C
by txesmi. 08/03/20 11:49
Price clusters
by jcl. 08/03/20 10:04
Zorro.exe return codes
by jcl. 08/03/20 09:41
objective - based to DD
by Grat. 08/03/20 05:14
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
9 registered members (txesmi, aariassanta, deepscreener, exile, AndrewAMD, Jerome8911, Dooley, Zheka, 1 invisible), 474 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Al82, Alibert, jsch, daan, TianYu
18487 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
plotHeatmap is not working #480993
07/29/20 22:47
07/29/20 22:47
Joined: May 2020
Posts: 22
A
AdamWu Offline OP
Newbie
AdamWu  Offline OP
Newbie
A

Joined: May 2020
Posts: 22
Hi I was using the exact code of manual to plot assets correlation heat map:
Manual
Code
#define DAYS  252 // 1 year
#define NN    30  // max number of assets
#include <profile.c>
// plot a heatmap of asset correlations
function run()
{
  BarPeriod = 1440;
  StartDate = 20150101;
  LookBack = DAYS;

  vars Returns[NN];
  var Correlations[NN][NN]; // NN*NN matrix
  int N = 0;
  while(asset(loop("USD/CAD","EUR/USD","GBP/USD"))) 
  {
    Returns[N] = series((price(0)-price(1))/price(0));
    N++; // count number of assets
  }
  
  int i,j;
  if(!is(LOOKBACK)) {
    for(i=0; i<N; i++)
      for(j=0; j<N; j++)
        Correlations[N*i+j] = Correlation(Returns[i],Returns[j],DAYS);

    plotHeatmap(Correlations,N);
    quit("");
  }
}


But it olny shows a blank plot, have a look at the attachment.

And there is no warning/error message in the console:
Quote

_correlation_check compiling................
Test: _correlation_check 2015..2020


Some info:
Zorro version: 2.25
Broker: FXCM (demo)

Attached Files heatmap_bug.JPG
Last edited by AdamWu; 07/29/20 22:53.
Re: plotHeatmap is not working [Re: AdamWu] #481040
11 hours ago
11 hours ago
Joined: Jul 2000
Posts: 27,295
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,295
Frankfurt
Yes. The example used an old preliminary plotHeatmap version. This will be corrected.


Moderated by  jcl, Nems, Spirit, Tobias 

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