Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Nymphodora, AndrewAMD, TipmyPip, Quad, Imhotep), 847 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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