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 😉
Positionprice gives you the average price open of the whole opened orders if you don’t use (1)
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 :/
FIXED
Moved “IF NOT ONMARKET” conditions after “ON MARKET” ones…