Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
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
4 registered members (7th_zorro, Quad, VoroneTZ, 1 invisible), 623 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Plot Balance curves #475869
01/11/19 08:39
01/11/19 08:39
Joined: Aug 2016
Posts: 3
K
krlitoos Offline OP
Guest
krlitoos  Offline OP
Guest
K

Joined: Aug 2016
Posts: 3
Hello everyone,

After reading the article of White's Reality Check I decided to play a little bit with the code to improve my knowlodge of C-Lite and Zorro.

I'm trying to adapt the script to plot the curves rather than the histogram with the profit factors. It seemed easy but I've been struggling with the code without success.

To simplify the problem I decided to just plot the best performer curve.

Here are some of the modifications that I've tryied:

Code:
void main()
{
  byte *Content = file_content("Log\TrendDaily.bin");
  int i,j,N = 0;
  int MaxN = 0;
  var MaxPerf = 0.0;
	
  while(N<900 && *Content)
  {
// extract the next curve from the file
    ...

// store and plot the curve		
    ...
    //_plotHistogram("Profit",Performance,0.005,RED); // Comment this line
	
// find the best curve		
    ...
  }
  
// NEW: Plot best curve 
  plot("Profit",Curve[MaxN].Values,LINE,BLACK); // Doesn't work.
}


As the chart doesn't show anything I thought that maybe I should plot the values inside the run function, so I modified the code to:

Code:
void run()
{
	set(PLOTNOW);
	if(is(INITRUN))
	{
		// Read all curves code
		byte *Content = file_content("Log\TrendDaily.bin");
		int i,j,N = 0;
		int MaxN = 0;
		var MaxPerf = 0.0;
		...
	}
// NEW: Plot best curve. In this case the Values are always 0
	plot("Profit",Curve[MaxN].Values,LINE,BLACK); 
	
}


And this code produces a chart with Dates in the x-axis but not the balance.
Any advice or idea will be a big help.
Thanks

Re: Plot Balance curves [Re: krlitoos] #475909
01/13/19 02:17
01/13/19 02:17
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
Your script does not show what youre plotting, but the plot call itself looks already wrong, seems youre only plotting the first value. A curve is made from many different values, one for any bar, like Curve[MaxN].Values[Bar] or so.

Re: Plot Balance curves [Re: Petra] #475920
01/13/19 23:26
01/13/19 23:26
Joined: Aug 2016
Posts: 3
K
krlitoos Offline OP
Guest
krlitoos  Offline OP
Guest
K

Joined: Aug 2016
Posts: 3
With the following code inside the run function:
Code:
plot("Profit",Curve[MaxN].Values[Bar],LINE,BLACK);


I receive the following message:
Quote:
Syntax error: Wrong type CONV:POINTER::DOUBLE


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