Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, EternallyCurious, Petra, 1 invisible), 788 guests, and 4 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
Erasing a datapoint in a plot array #480732
07/05/20 13:04
07/05/20 13:04
Joined: Dec 2019
Posts: 53
ozgur Offline OP
Junior Member
ozgur  Offline OP
Junior Member

Joined: Dec 2019
Posts: 53
I can manipulate past datapoints in a plot using plotData() in a function like below. Now I'd like to erase a past datapoint, what value I should assign to respective element in the plot array?

From log file, "empty" elements (hence not plotted) of a plot array seem to have ~1.7*10^308 (DBL_MAX?) value. Is there a defined macro for this value in lite-C? I tried defining myself but all I've got is an empty chart.

Thanks.

Code
void plotSet(string name, var val, int offset)
{
	if (offset >= 0) { // Only modify the past
		DATA* plotHistory = plotData(name);
		var* plotHistoryData = plotHistory->Data;
		
		if (plotHistoryData) { // If plot data has valid pointer
			int firstBar = plotHistory->start;
			int lastBar = plotHistory->end;
			int curBar = lastBar - offset;
			
			if (curBar > firstBar) { // If target bar is valid plot
				plotHistoryData[curBar] = val;
			}
		}
	}
}

Re: Erasing a datapoint in a plot array [Re: ozgur] #480739
07/06/20 09:51
07/06/20 09:51
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, the charting package uses the number 1.7e308 as a "no value" element. But you cannot enter this number directly in a lite-C script. You could copy it from a known plot element with no value.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1