This is with the recent MC 8.5 Beta 2. IOG ON. Please fix this...
Buy at open/Sell at open bug
Buy at open/Sell at open bug
- Attachments
-
- Open_Orders.png
- (34.88 KiB) Downloaded 3042 times
Last edited by MAtricks on 04 Feb 2013, edited 1 time in total.
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: Buy at open/Sell at open bug
I tried your code on ES 15 min bars and it seems to work correctly..
What instrument and time frame are you using ?
What instrument and time frame are you using ?
- Attachments
-
- Sigs on open.png
- (42.09 KiB) Downloaded 896 times
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: Buy at open/Sell at open bug
***************************************************************that was 5 minute bars.. weird that it worked for you. Intra-bar Orders ON?
I was using 15 minute ES bars. I tried it with and without IOG , it works the same either way..
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Buy at open/Sell at open bug
Maybe your codes need a review?not sure what to tell ya. That screen shot isn't photoshopped.
Re: Buy at open/Sell at open bug
Sure, review it. The execution is:
Buy next bar open ;
Sellshort next bar open ;
Which SHOULD execute at the open of the next bar.
Buy next bar open ;
Sellshort next bar open ;
Which SHOULD execute at the open of the next bar.
Last edited by MAtricks on 04 Feb 2013, edited 2 times in total.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Buy at open/Sell at open bug
that's different from what you had in the 1st post.Sure, review it. The execution is:
Buy next bar at open stop ;
sellshort next bar at open stop ;
Re: Buy at open/Sell at open bug
that's different from what you had in the 1st post.Sure, review it. The execution is:
Buy next bar at open stop ;
sellshort next bar at open stop ;
Sorry for not checking the lines of code to make absolutely sure how I coded it.. The original post is correct.
Regardless, the flaw stands. Buying at the low and selling at the high isn't what "buy next bar market" Or "buy next bar market ; "should do.
Last edited by MAtricks on 04 Feb 2013, edited 1 time in total.
Re: Buy at open/Sell at open bug
60 Minute bars:
- Attachments
-
- 2013-02-03_2259.png
- (77.98 KiB) Downloaded 1057 times
Re: Buy at open/Sell at open bug
I believe I've narrowed down the problem a bit more. Looking over my code I see a simple variable that's making this happen. It was in my "begin" statement. Try adding this to a test strategy and see what you come up with: (IOG doesn't matter)
If C < C[1] then sellshort next bar open ;
If C > C[1] then buy next bar open ;
If C < C[1] then sellshort next bar open ;
If C > C[1] then buy next bar open ;
- Attachments
-
- 2013-02-03_2326.png
- (143.62 KiB) Downloaded 1035 times
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: Buy at open/Sell at open bug
Hello MAtricks,
Please come to our Live Chat Mon-Fri from 6:30 AM to 10 AM EST to demonstrate the issue: http://messenger.providesupport.com/mes ... pport.html
Please come to our Live Chat Mon-Fri from 6:30 AM to 10 AM EST to demonstrate the issue: http://messenger.providesupport.com/mes ... pport.html
Re: Buy at open/Sell at open bug
MAtricks,
I spent some time with the Live Chat and my understanding is that for it to work correctly you have to use Barstatus=2 in your code:
if BarStatus=2 then begin
if C < C[1] then buy next bar open;
if C > C[1] then sellshort next bar open;
end;
or
Use barmagnifier
I spent some time with the Live Chat and my understanding is that for it to work correctly you have to use Barstatus=2 in your code:
if BarStatus=2 then begin
if C < C[1] then buy next bar open;
if C > C[1] then sellshort next bar open;
end;
or
Use barmagnifier
Re: Buy at open/Sell at open bug
Thanks Super.
I'm unsure where the complication is on this line of code that would require a barstatus = 2.
If C > C[1] then buy next bar open ;
or in english:
if the close is more than the last close, place a buy order at the open of the next bar.
If C < C[1] then sellshort next bar open ;
or in english:
if the close is less than the last close, place a sell order at the open of the next bar.
This doesn't make sense that a barstatus = 2 statement is needed, but I'll give it a shot if that's their workaround.
I'm unsure where the complication is on this line of code that would require a barstatus = 2.
If C > C[1] then buy next bar open ;
or in english:
if the close is more than the last close, place a buy order at the open of the next bar.
If C < C[1] then sellshort next bar open ;
or in english:
if the close is less than the last close, place a sell order at the open of the next bar.
This doesn't make sense that a barstatus = 2 statement is needed, but I'll give it a shot if that's their workaround.
Re: Buy at open/Sell at open bug
With IOG on arrival of each new tick "C" will change, so on live trade your order will get filled as soon as the condition is meet. But on historical orders the code runs four times on each bar comparing Open - High -Low - Close to establish if condition is meet, these are the only reference points it has for comparision if you have not selected bar magnifier.Thanks Super.
I'm unsure where the complication is on this line of code that would require a barstatus = 2.
If C > C[1] then buy next bar open ;
or in english:
if the close is more than the last close, place a buy order at the open of the next bar.
If C < C[1] then sellshort next bar open ;
or in english:
if the close is less than the last close, place a sell order at the open of the next bar.
This doesn't make sense that a barstatus = 2 statement is needed, but I'll give it a shot if that's their workaround.
For testing on Historical orders "Barmagnifier" is must.