Day profit or lose in %

Created at 01 Mar 2017, 22:40
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
mindbreaker's avatar

mindbreaker

Joined 19.07.2014

Day profit or lose in %
01 Mar 2017, 22:40


Hi, how get symbol price change in % ? (day change for example) ?


@mindbreaker
Replies

mindbreaker
02 Mar 2017, 15:31

RE:
function kurs($today,$yesterday){
	if ($today>$yesterday) {
		echo "+".$p = ($today/$yesterday)."%";		
		// $yesterday * $p;		
	}else{
		echo "-".$p = ($yesterday/$today)."%";		
		// echo $today * $p;		
	}
}

 


@mindbreaker

mindbreaker
02 Mar 2017, 15:55 ( Updated at: 21 Dec 2023, 09:20 )

I need something like this:

How get % values?


@mindbreaker

mindbreaker
02 Mar 2017, 16:04 ( Updated at: 21 Dec 2023, 09:20 )

and multiply 100


@mindbreaker