Tradeprice and Limits
Forums › ProRealTime English forum › ProOrder support › Tradeprice and Limits
- This topic has 6 replies, 4 voices, and was last updated 5 years ago by Nicolas.
-
-
02/23/2017 at 6:00 PM #26204
Hi Guys, Hoping you can help…….
My question is in 2 parts:
1: I enter a buy position, and i can tell what the entry is by Tradeprice(1)
Then a few bars later I enter a 2nd (cumulate) buy position.
Question: Is the 1st position still Tradeprice(1) and the 2nd position Tradeprice(2)? (or visa versa)?2: I enter a buy position, with Take Profit (Limit) at 20 pips
Then a few bars later buy another (cumulative) position. (My 2nd added position also then automatically has a Take Profit of 20 pips).
I now have 2 positions both with a Take profit of 20 pips
Question: How do i now alter only the 1st position to take profit at a different level (ie change the limit to say 50 only on the 1st position)?Any help is appreciated.
02/23/2017 at 9:53 PM #26234Hello pips_103,
- The very last position opened is tradeprice(0). So the order is in reverse from when the trades were executed.
- Maybe this thread will help: https://www.prorealcode.com/topic/stop-loss-profit-target-do-they-affect-all-positions/
Concerning 2) does this help?
1 user thanked author for this post.
02/24/2017 at 11:00 AM #2626302/25/2017 at 11:43 AM #26332Hello Pips,
just got into this topic myself and found this in the proorder manual:
Multiple stop and target levels
Only one “Set Stop” and one “Set Target” command can be active at a time under normal circumstances. If there are successive “Set Stop” or “Set Target” commands in a code, the last command replaces the previous command.
Example:
1234567SET STOP %LOSS 10 // Set a stop loss of 10%SET TARGET PROFIT 50 // Set a profit target of 50 unitsSET TARGET %PROFIT 5 // Removes the previous target of 50 units and replaces it with a profit target of 5%SET STOP %TRAILING 2 // Removes the previous 10% stop loss and replaces it with a trailing stop of 2%So, I guess the answer is “no”, unfortunately.
02/25/2017 at 11:44 AM #2633303/22/2019 at 7:10 AM #94374The very last position opened is tradeprice(0). So the order is in reverse from when the trades were executed.
Follow up on this — on a candle there could be an “buy long” order that happens as well as “trailing stop loss” order triggered exiting a previous position (or perhaps the one you just entered if it’s a long candle).
Question — in your code how do you know/determine which came first on that candle and what the value of each order was?
THank you
03/22/2019 at 8:54 AM #94380 -
AuthorPosts