distance calculation with TRADEPRICE

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #218654 quote
    supernova
    Participant
    New

    I’m new to prorealcode and I’m just looking over the documentation  / trying my first scripts, however when I look here https://www.prorealcode.com/documentation/tradeprice in the examples it says close-TRADEPRICE

     

    Looking here: https://www.prorealcode.com/documentation/breakeven/

    high-tradeprace and tradeprice-low is used

    Where does that close- come from? Can I prefix this to any candlestick ? Can anyone point me to the doc where this close- and maybe other prefix / afixes are documented ?

     

    cheers

    #218655 quote
    PeterSt
    Participant
    Master

    Hi there,

    if high-tradeprice >= 10*pointsize then

    Hyphens (-) do not exist in the ProRealCode / ProBuilder language, so this is to be read as

    if high - tradeprice >= 10*pointsize then

    Regards,
    Peter

    #218660 quote
    Nicolas
    Keymaster
    Master

    Candlesticks have constants price: Open, High, Low and Close

    Close – TRADEPRICE

    is a subtract of these 2 price constants that give a distance in price.

    #218671 quote
    JS
    Participant
    Senior

    Because you’re new… 🙂

     

    As you have read, the “TradePrice” is the price level at which the last order was executed…

    You can now, in combination, check different situations with this TradePrice for example, am I in profit with my purchased (Long) contract?

    If Close – TradePrice > 0 then (yes, I am in profit)

     

    Of course, instead of the “Close”, you can also use “Low”, “High” or “Open”…

    In general, you can check what the situation is in relation to the price (TradePrice) for which you have bought / sold something…

     

    Note: TradePrice=TradePrice(0)=TradePrice(1)

    #218674 quote
    supernova
    Participant
    New

    Okay got It, thanks very much, now it makes sense.

    #218676 quote
    MauroPro
    Participant
    Veteran

    I would like to emphasize just one important thing that reminded me Roberto in an old post: tradePrice(1) is non the entry price, but simply the last traded price.

    So, when you are NOT AT MARKET tradePrice(1) is the exit price of the last position and the entry price is tradePrice(2).

    Nicolas and JS thanked this post
    #218677 quote
    Nicolas
    Keymaster
    Master

    So, when you are NOT AT MARKET tradePrice(1) is the exit price of the last position and the entry price is tradePrice(2)

    Yes because an exit is actually an order, so a trade, so a new TRADEPRICE

    😉

    #218704 quote
    supernova
    Participant
    New

    so it behaves like an array for every order that occured and every order gets pushed onto it?

    thanks for the additional information

     

    btw.. i searched and didn’t find anything, is there maybe a discord channel for prorealcode ?

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

distance calculation with TRADEPRICE


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
supernova @supernova Participant
Summary

This topic contains 7 replies,
has 5 voices, and was last updated by supernova
2 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/06/2023
Status: Active
Attachments: No files
Logo Logo
Loading...