Get the value Gains & losses curve ?

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #212653 quote
    ZeroCafeine
    Participant
    Senior

    hi,

    how to get the value of Gains & losses curve c when the trade is still open ?

    Capture-decran-2023-04-02-a-11.12.28.png Capture-decran-2023-04-02-a-11.12.28.png
    #212656 quote
    GraHal
    Participant
    Master

    Try …

    GRAPH PositionPerf

    ZeroCafeine thanked this post
    #212659 quote
    ZeroCafeine
    Participant
    Senior

    tks you @GraHal,

    So I tried it and it’s like working nice, so this means :
    – PositionPerf = 0 ==> the position is still flat ?
    – PositionPerf = 0,2 ==> mean the position are +20% grain ?
    – PositionPerf = 1,4 ==> mean the position are +140% grain ?

    // Achète si le trade précédent a fait au moins 20% de gains
    IF NOT ONMARKET AND PositionPerf(1) > 0.2 THEN
     BUY 1000 CASH AT MARKET
    ENDIF
    Capture-decran-2023-04-02-a-12.50.13.png Capture-decran-2023-04-02-a-12.50.13.png
    #212661 quote
    GraHal
    Participant
    Master

    PositionPerf = 0,2 ==> mean the position are +20% grain ?

    20% gain of what? 🙂

    PositionPerf = 0.01 means PositionPerf is 1% as defined here …

    POSITIONPERF

    #212665 quote
    MauroPro
    Participant
    Veteran

    “PositionPerf = 0,2 ==> mean the position are +20% grain ?”  Yes.

    If you want the percentage of the trade still open you have to multiply *100 positionPerf:

    graph positionPerf*100

    ZeroCafeine thanked this post
    #212666 quote
    ZeroCafeine
    Participant
    Senior

    20% gain of what? 🙂

    0,2 it’s mean +20% from the price entry of the last position, and I do some math and the PRT software use the Close price to calculate this value, let give an other exemple and tell me if I’m wrong,

    for exemple I have an entry price at 118 and if my PositionPerf[0] now it’s at 0,053 so it’s mean the close prie now is normaly at 124,
    Entry Price = 118
    PositionPerf = 0,053
    Entry Price x PositionPerf x 100 = 118 x 0,053 x 100 = 124,25 = Close[0]

    correct me pls if I’m wrong,

    the idea is to get price of equity even we are in position, not just after close the trade ?

    #212667 quote
    robertogozzi
    Moderator
    Master

    If you need to know the PositionPerf while a candle is forming, then you have to resort to MTF and use a a smaller TF.

    ZeroCafeine thanked this post
    #212673 quote
    GraHal
    Participant
    Master

    correct me pls if I’m wrong,

    The link below defines PositionPerf (which isn’t how think it works! 🙂 )

    https://www.prorealcode.com/documentation/positionperf/

    #212687 quote
    JS
    Participant
    Senior

    The “PositionPerf” in PRT is calculated as follows:

    PositionPerf = (Close – PositionPrice) / PositionPrice * 100

    #212780 quote
    ZeroCafeine
    Participant
    Senior

    If you need to know the PositionPerf while a candle is forming, then you have to resort to MTF and use a a smaller TF.

    Thank you for your answer, I understand the idea of going down to smaller units of time, however what is the smallest unit of time that can be used, is it possible for example units in Tick or does it depend on the Stocks processed,

     

    If you have a link you can share from the forum it would be appreciated

    #212791 quote
    GraHal
    Participant
    Master

    what is the smallest unit of time that can be used

    I’ve never used < 1 second … never found the need?

    I’ve never got a strategy to work consistently at < 5 sec TF.

    ZeroCafeine thanked this post
    #212811 quote
    robertogozzi
    Moderator
    Master

    Ticks cannot be used, use 1-second TF.

    ZeroCafeine thanked this post
    #212875 quote
    Nicolas
    Keymaster
    Master

    Calculation of POSITIONPERF, topic with explanation: https://www.prorealcode.com/topic/i-dont-understand-exactly-the-value-of-positionperf/

    Also in order to get the current floating profit of orders, you can use this code snippet:

    //floating profit
    floatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize //actual trade gains

    A new instruction with the current STRATEGYPROFIT (strategyprofit + floating) will also be added with a lot of other new ones.

    ZeroCafeine thanked this post
Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.

Get the value Gains & losses curve ?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 12 replies,
has 6 voices, and was last updated by Nicolas
2 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/02/2023
Status: Active
Attachments: 2 files
Logo Logo
Loading...