Gamestudio Links
Zorro Links
Newest Posts
Where's the Wiki?
by Quad. 06/25/19 22:16
Published Gamestudio Games?
by Dooley. 06/25/19 16:59
Updating to A8 [SOLVED]
by Dooley. 06/25/19 16:00
Message from IB of open position
by Zheka. 06/25/19 13:58
FXCM: "Can't connect to price server"
by riinvest. 06/25/19 10:35
New Zorro version 2.12
by jcl. 06/25/19 09:42
Aum120 is ready
by Emre. 06/24/19 17:54
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
5 registered members (JeyKey II, wdlmaster, alibaba, jenGs, kvm), 574 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Theaisback, redye, rhe2564, Qw3rty, Dal
18239 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: 2
K
krlitoos Offline OP
Guest
krlitoos  Offline OP
Guest
K

Joined: Aug 2016
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

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

Joined: Apr 2008
Posts: 238
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: 2
K
krlitoos Offline OP
Guest
krlitoos  Offline OP
Guest
K

Joined: Aug 2016
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


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