Last position type
Forums › ProRealTime English forum › ProOrder support › Last position type
- This topic has 9 replies, 4 voices, and was last updated 5 years ago by Nicolas.
-
-
07/19/2017 at 3:56 PM #41088
Hi, how do I test the last loss-position type something like…?
If PositionPerf(1) < 0 and OnMarket[1]=1 Then
07/19/2017 at 4:56 PM #4109207/19/2017 at 5:15 PM #4109307/19/2017 at 5:29 PM #4109407/19/2017 at 5:39 PM #4109507/25/2017 at 2:53 PM #41585In this case, why do not save in a variable the type of the order you are launching at market:
123456789if BuyCondition thenBUY 1 CONTRACT AT MARKETordertype = 1 //it's a buy order !endifif SellCondition thenSELLSHORT 1 CONTRACT AT MARKETordertype = -1 //it's a sell order !!endif08/02/2017 at 7:04 PM #42355Indeed, I thought of that, I wondered if there was another way.
Thanks.
08/09/2019 at 12:41 PM #104468Hi, I want to know the same thing but I’m using a stop order.
I this case I don’t know when the order will be triggered in and I’m placing a short and a long order at the same time.
I’m interested to find out what order was closed. if one of the orders is closed (winner), the other order that was not triggered needs to be removed (not renewed).
Thanks
08/09/2019 at 1:10 PM #10447008/16/2019 at 8:34 AM #104841Little code snippet to check the profit of the last order and its direction:
12345678910111213//------------------//check profitif strategyprofit<>strategyprofit[1] thenif positionperf(1)>0 thenif close<tradeprice(2) thengain=-1 //was sellelsif close>tradeprice(2) thengain=1 //was buyendifelsegain=0endifendif -
AuthorPosts
Find exclusive trading pro-tools on