Issue with n perpoint in subsequent order
Forums › ProRealTime English forum › ProRealTime platform support › Issue with n perpoint in subsequent order
- This topic has 6 replies, 2 voices, and was last updated 8 years ago by Big Hug.
-
-
05/30/2016 at 8:23 PM #8425
Hi Peeps,
I have been trying to get this to work but I’m not having any success…
12345678IF c1 AND NOT LongOnMarket THENBUY 2 PERPOINT AT MARKETENDIF//let's add another order while price continue to move lower (more than 10 points) than the last order taken with a condition of 5 bars elapsed since thenIF TRADEINDEX(1)>5 AND Close-TRADEPRICE(1)>10 AND C1 AND LongOnMarket THENBUY 2 PERPOINT AT MARKETENDIFWhen I run this – in the Orders List – I get an initial Trade of 2 perpoint followed by 1 perpoint ( IG Index is a minimum of 2 ) – so this order will not be executed.
I’m slightly confused why it isn’t accepting the “2” as opposed to “1” and where it is referencing “1” from
** Also when I go to – Auto Trade this it tells me
“The following changes must be applied before sending the code to pro order trading systems with orders that partially close a position cannot be sent to project for example cell-free shares at market make sure that no quantity is specified in the instructions to close positions brackets in this case the instruction closest in tile position) example sell at market return X it short at 1.5 limits ”
I’ve tried all various coding terms and it’s still sending me this notice.
Many thanks for any suggestions..
Regards
Hugh
05/30/2016 at 9:06 PM #8441I’m sorry, but the code you are using is wrong, and it is my fault 🙁 Because this code came from the documentation, I changed it recently into the TRADEINDEX term page but not in the TRADEPRICE one which share this same code example.
To add orders when there is already 5 bars elapsed, the code should be this one :
123IF BARINDEX-TRADEINDEX(1)>5 AND Close-TRADEPRICE(1)>10 AND LongOnMarket THENBUY 1 CONTRACTS AT MARKETENDIFFor the “perpoint” problem, if you change the “perpoint” with “share”, does the problem still exist?
It is not possible to partially close an order, so I believe you try to do it in your code, that’s why you get this error message. For example, if you BUY 2 SHARES somewhere in your code, then you can’t SELL 1 SHARE elsewhere, if you want to close your buy orders, you must use SELL AT MARKET (all orders will be closed instead of fractionnal one which is not possible).
05/30/2016 at 10:34 PM #8448Hi Nicolas
Thank you for your sterling work.
I’ve edited the coding as follows:
12345678IF c1 AND NOT LongOnMarket THENBUY 2 PERPOINT AT MARKETENDIF//let's add another order while price continue to move lower (more than 10 points) than the last order taken with a condition of 5 bars elapsed since thenIF BARINDEX-TRADEINDEX(1)>5 AND Close-TRADEPRICE(1)>10 AND LongOnMarket THENBUY 2 PERPOINT AT MARKETENDIFAt the moment it appears I’m not getting the subsequent order to the initial order.
Picture attached.
Regards
Hugh
p.s. going to try to replace per point with contract ………….
05/31/2016 at 9:33 AM #8485Ok, so what you want to do here is averaging down your first order? Buying lower than your initial buy order.
If the answer is yes there is a wrong calculation here:
1Close-TRADEPRICE(1)>10This should be:
1TRADEPRICE(1)-Close>10Also, you should convert your “10” points value to the instrument point value accordingly and to be “universal” with any instrument:
1TRADEPRICE(1)-Close>10*pipsize05/31/2016 at 10:54 AM #850706/09/2016 at 9:52 PM #9146Hi
Using 1 Min Chart
I was trying to do this code so that after the first order it will only repeat the order if the price has moved lower/higher .
(Averaging up or down as per Nicolas’s message)
I keep getting a warning sign – code not working as per picture
06/09/2016 at 10:05 PM #9149 -
AuthorPosts
Find exclusive trading pro-tools on