calculate position-performance

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #122330 quote
    Paul
    Participant
    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.

    #122336 quote
    Paul
    Participant
    Master

    fixed topic can be deleted.

    #122346 quote
    Nicolas
    Keymaster
    Master

    Would be great to share your solution, that could help someone else in the future!

    #122349 quote
    Paul
    Participant
    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
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

calculate position-performance


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Paul @micky75d Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Paul
5 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/17/2020
Status: Active
Attachments: No files
Logo Logo
Loading...