Adjustment in code because combined stops can not be used with pro order

Forums ProRealTime English forum ProOrder support Adjustment in code because combined stops can not be used with pro order

Viewing 15 posts - 16 through 30 (of 35 total)
  • #107151

    Move line 39 to line 32.

    #107408

    Hi

    I want to know if it is possible to keep orders open until one is filled then after candle close it must close other pending order. Reason why i ask is. the system now places 2 pending orders. But if they are not triggered in the first 5 min the system closes both of them.  And like today it took more then 5 minutes for price to pass the point where pending order was.  I hope its clear. Just keep orders open until 1 is filled and then close other order.

     

    Thank you for all your help

    #107416

    Pending orders only last one bar and need to be placed again and again, if needed.

    As you have written your conditions at present the two orders will be placed continuously if not OnMarket since STARTTIME is always true, being 090000.

    #107426

    This version allows 1 trade per day and keeps the orders on the market until one (or both) are filled.

    I added a variable v as I couldn’t find any 20 pip breakouts on the Russell 2000 index.

    Moderators Note: Code edited to remove incorrect lines 30 and 31.

    #107427

    Thank you

    The thing is after 5 min both sell and buy orders were gone. today at 9:05 pending order were deleted. I dont know why an how to change the code so it places trades until one is triggered.

     

    #107441

    Delete lines 30 and 31 in my last code as they accidentally got left in from your incorrect code that you posted before. They will stop the orders from being placed again.

    #107442

    Here is an MTF version that can be used on the 1 second time frame to ensure that orders in the opposite direction are cancelled a soon as an order is filled.

     

    #107457

    Hi

    Thank you again for the help.. I have tried you new code from the post this morning..  It works great but if i remove line 30-31 it just keeps on placing orders during the day. What I want is for the system just to place pending orders until 1 is filled and when bar close it closes other pending order.

    So it must only do the 1 trade per day but must keep orders at that level until it is activated. If for some reason both is activated one will close and we go in the other direction so that is ok. I just need it to keep order open until its triggered. But for example if buy trade is activated on the close of the bar where it is activated it must close the sell pending order.  So keep orders open until 1 is activated. Thats it.

    Thanks again

    #107477

    You must be doing something wrong then because it works just fine when I test it. In the image which is on the 1 minute chart the flag switch is graphed and when it is 1 it is impossible for another trade to be opened. It works exactly as it should.

    #107489

    No not the MTF code

    this code

     

    #107493

    Yes that code is the one and it works just fine for me.

     

    #107501

    but if i remove line 30-31 it just keeps on placing orders during the day.

    Did you see the note from Vonasi below as maybe you have removed Line 30-31 when Vonasi had already removed Line 30-31.

    Just a thought / trying to help … don’t shoot the messenger! 🙂

     

    Vonasi wrote:

    Moderators Note: Code edited to remove incorrect lines 30 and 31.

     

    #107507

    Just a thought / trying to help … don’t shoot the messenger!

    I edited it after my last post – I did worry that it might lead to confusion – hence the moderators note!

    Why don’t you also test the code GraHal then if it works OK for you too then we know that it is definitely something Lombard974 is doing wrong?

    #107802

    Hello Guys

    Yes  i understand what you means and i saw the note.. If i removed the lines it just kept on placing trades during the day. I dont know how to limit it to just 1 trade. But keep orders open until 1 is filled.

    This code below works great on testing with tick by tick and spread. But still orders are canceled after close of first 5 min candle and maybe trade comes a little later. So i want to keep orders open until 1 is filled. The biggest problem with this code is some days it doesnt trade at all? I dont know why? But what I think is system can place trades because its too close to price.. How can this be adjusted to place trade at the nearest available price?

    Thanks

     

    #107819

    So now we can see the problem. You have modified the code and you are not testing exactly the same code that I am!!!

    You have changed your pending order levels and yes if they are calculated too close to price then the orders will be rejected. The only way to overcome this is to never send orders too close to price!

    You can set a minimum distance using a MAX and a MIN in the order price calculation.

    Obviously you are no longer buying at your desired 6 candle highest high and lowest low prices though.

     

     

Viewing 15 posts - 16 through 30 (of 35 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login