Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Petra, AndrewAMD, Quad, VoroneTZ, 1 invisible), 488 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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: 586
Austria
Petra Online
Support
Petra  Online
Support

Joined: Apr 2008
Posts: 586
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