PaulParticipant
Master
Hello,
How do I calculate the position-performance for long & short, from the value I want to use.
I don’t want position-performance to be calculated from the given price of the broker as in code below, but calculated from the “close” value before the market order is executed. This on the dji.
entryprice is defined when a position is opened.
if pp<-0.15 then
sell at market
exitshort at market
endif
Thank you.
PaulParticipant
Master
fixed topic can be deleted.
Would be great to share your solution, that could help someone else in the future!
PaulParticipant
Master
I was in the need for coffee when I asked. This is what I settled on.
if longonmarket then
graph entryprice
ppc=((close-entryprice)/100) //custom
if ppc<-0.2 then
sell at market
endif
endif
if shortonmarket then
graph entryprice
ppc=((entryprice-close)/100) //custom
if ppc<-0.2 then
exitshort at market
endif
endif