Page 1 of 1

Calulate profit or loss w/ HLine

Posted: Thu Dec 29, 2022 12:56 pm
by icesky
Hi everyone,

I'm a newbie on forum. This is my first topic. I'm trying to code an indicator that calculate all average of open or pending position as buy average/sell average/total average.

I wrote it and its work. I want to create a random horizontal line on chart and calculate profit/loss with my averages and distance of this HLine.
I could'nt code how to write the averages above line.
I also want that when I move the HLine it will calculate profit/loss and show above this line.

This indicator will be open source and we can develop it up all together.

Thanks.

Re: Calulate profit or loss w/ HLine

Posted: Thu Dec 29, 2022 2:02 pm
by Chickenspicy
icesky wrote: Thu Dec 29, 2022 12:56 pm
Is it Atr multiplied?
I’ve seen something like
I’m not coder though

I think this one is close

Re: Calulate profit or loss w/ HLine

Posted: Thu Dec 29, 2022 2:43 pm
by icesky
chickensword wrote: Thu Dec 29, 2022 2:02 pm Is it Atr multiplied?
I’ve seen something like
I’m not coder though

I think this one is close
Image
I'm talking about completely different things. Also thank you for the reply.