PositionPrice not showing

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6545 quote
    Adolfo
    Participant
    Senior

    Hi everyone!

    I’m a little confused since PositionPrice is not showed sometimes, the image below shows it.

    My question is, why?

    Maybe some wrong code lines? Sure… Do have an idea what the problem should be?

    Adolfo.

     

    This is the code part producing the error.

    IF NOT OnMarket THEN
    PipsBreakEven = 10*PipSize
    StopBreakEven = 0
    IF compra=1 and lasttrade>1 then
    BUY myLOT SHARE AT preciocompra LIMIT
    SET STOP pLOSS 30
    //SET TARGET pPROFIT 25
    ENDIF
    
    REM Entrada de posiciones cortas
    IF venta=1 and lasttrade>1 THEN
    SELLSHORT myLOT SHARE AT precioventa LIMIT
    SET STOP pLOSS 30
    //SET TARGET pPROFIT 25
    ENDIF
    ENDIF
    
    
    IF LongOnMarket THEN
    BreakEven = Close-PositionPrice>PipsBreakEven
    IF BreakEven THEN
    StopBreakEven = PositionPrice+1*PipSize
    ENDIF
    SELL AT StopBreakEven STOP
    ELSIF ShortOnMarket THEN
    BreakEven = PositionPrice-Close>PipsBreakEven
    IF BreakEven THEN
    StopBreakEven = PositionPrice-1*PipSize
    ENDIF
    ENDIF
    
    Graph positionprice
    graph stopbreakeven

    Thx in advance 😉

    No-positionprice.jpg No-positionprice.jpg nopositionprice.png nopositionprice.png No-positionprice-1.jpg No-positionprice-1.jpg
    #6563 quote
    Nicolas
    Keymaster
    Master

    Positionprice gives you the average price open of the whole opened orders if you don’t use (1)

    #6566 quote
    Adolfo
    Participant
    Senior

    Hi Nicolas, thanks for your answer as always ready to help.

    So, when a position is open, POSITIONPRICE should be the last position open. In the attached image you can see how last position was correctly but the one cursor is over is showing “0”. I’m missing something :/

    #6567 quote
    Adolfo
    Participant
    Senior

    FIXED

    Moved “IF NOT ONMARKET” conditions after “ON MARKET” ones…

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

PositionPrice not showing


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Adolfo @adolfo_onrubia Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Adolfo
9 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/07/2016
Status: Active
Attachments: No files
Logo Logo
Loading...