Gamestudio Links
Zorro Links
Newest Posts
Blog Post: Get Historical Data from Darwinex REST API w/ Zorro
by AndrewAMD
Yesterday at 22:19
Reseting a static variable - the next day
by OptimusPrime
Yesterday at 19:48
Correlation -1.#IND00
by AndrewAMD
Yesterday at 17:44
Basic thread safety question
by Superku
Yesterday at 17:43
Train algorithms separatery
by 3dgamelight
01/18/19 10:37
+BALANCED machine learning option
by jcl
01/18/19 08:37
IntraBar fluctuation
by jcl
01/18/19 08:31
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
4 registered (AndrewAMD, Superku, 2 invisible), 499 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
laz, ramonne, SibJac, Evael, NRW
18156 Registered Users
Topic Options
Rate This Topic
#475869 - 01/11/19 09:39 Plot Balance curves
krlitoos Offline
Guest

Registered: 08/22/16
Posts: 2
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

Top
#475909 - 01/13/19 03:17 Re: Plot Balance curves [Re: krlitoos]
Petra Offline
Member

Registered: 04/04/08
Posts: 213
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.

Top
#475920 - 01/14/19 00:26 Re: Plot Balance curves [Re: Petra]
krlitoos Offline
Guest

Registered: 08/22/16
Posts: 2
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

Top



Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de