Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by jcl. 04/20/24 08:52
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (7th_zorro, Aku_Aku, henrybane, flink, 1 invisible), 712 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 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: 45
A
AdamWu Offline OP
Newbie
AdamWu  Offline OP
Newbie
A

Joined: May 2020
Posts: 45
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
08/03/20 09:48
08/03/20 09:48
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
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