Posted By: Qw3rty
Maximum Value - 07/15/20 10:33
How do I get the maximum Equity Value over a period?
I have tried with MaxVal but not sure how pointers work:
vars max_value = series(MaxVal(Equity,500)); //Error - MaxVal(): Pointer expected
Any ideas?
Thank you
Posted By: AndrewAMD
Re: Maximum Value - 07/15/20 12:50
You need a vars (a pointer to an array of values), but Equity is a var (just one value).
So you need to feed the MaxVal function a vars of Equity, using series(), so that MaxVal can read an array of values.
Posted By: Qw3rty
Re: Maximum Value - 07/17/20 07:09
That's really helpful, thank you!
Posted By: Qw3rty
Re: Maximum Value - 07/18/20 02:06
Is there anyway of getting the same result without using MaxVal?
The reason I ask is I noticed that I need to make the period a huge value to store the maximum equity otherwise it can decrease in value.
Posted By: Qw3rty
Re: Maximum Value - 07/18/20 10:44
Looks like HH is for price but I'll try this with the Equity value. Thank you!
Posted By: danatrader
Re: Maximum Value - 07/18/20 11:20
For equity it will not work, didn't read it all.
Maybe you use maxVal on a static var.
Max value for last 48 hours and put it into a static var.