Strange results for variables
Forums › ProRealTime English forum › ProOrder support › Strange results for variables
- This topic has 8 replies, 4 voices, and was last updated 3 years ago by robertogozzi.
-
-
03/23/2021 at 2:13 PM #165038
Hi,
I noticed some strange results for indicators that are used in my pro order code.
I have now created a very simple example to show the issue. Of course, the real code that I want to use is different and the following example doesn’t make any sense, but it clearly shows the issue:
1234test = close * 100IF date = 20210308 THENBUY test CONTRACTS AT MARKETENDIFIf I run this example in the German DAX in 1-day-chart, I get the results shown in the scrrenshot below.
The close (displayed as “Schluss” in the screenshot) is 14,391.7, so with the code above, 1,439,170 contracts should be bought. I don’t know why, but only 1,409,430 contracts are bought. This means, the value for close must have been 14,094.3 and not 14,391.7.
Do you have an idea what happens here and how to fix it?
03/23/2021 at 2:23 PM #16504203/23/2021 at 2:32 PM #165044No, there is no limit for the number of contracts you buy. You can buy 10 million contracts. If you do so, you will probably be bankrupt a few seconds later, but the buy order is fulfilled.
I used the “buy test contracts” only to get the value of the variable.
03/23/2021 at 2:35 PM #165047Proorder code read at end of a candle, order sent to be executed as soon as the following tick, which is the beginning of next candle, if the candle you’re looking at is the one when the buy order was executed, then you need to watch the close of the previous candle to check test
03/23/2021 at 2:36 PM #16504803/23/2021 at 3:05 PM #16505103/23/2021 at 3:16 PM #165052Your graph seems to go from march 5 to march 8, so it seems to be with custom time settings (not displaying sunday’s). Proorder is server side and doesn’t use the custom settings, only probuilder on individual pc does. There is a close at 14094.3 on sunday March 7, opendate 20210307, date 20210308
1 user thanked author for this post.
03/23/2021 at 3:34 PM #16505703/23/2021 at 3:41 PM #165058It’s must be due to the fact that the order was placed at the closing of the Friday bar, while the trade was entered at the beginning of the Monday bars and there was a gap.
-
AuthorPosts
Find exclusive trading pro-tools on