Is exit code executed on next bar?

Forums ProRealTime English forum ProOrder support Is exit code executed on next bar?

Viewing 4 posts - 1 through 4 (of 4 total)
  • #154552

    Hi, basic question: are exit code executed on the next bar?  it seems yes when using probactest.

    If yes, how can I make it exit right away when the price hits that exitprice

    thanks for anyone that can advice.

    #154579

    Strategy code is read through at the close of a bar and any orders or market instructions sent through and actioned at the opening of the next bar.

    Use multi time frame in your code or use STOP and LIMIT orders to exit at a price.

    https://www.prorealcode.com/documentation/stop-pending/

    https://www.prorealcode.com/documentation/limit/

     

    #154697

    Thanks Vonasi, so it will be happen on the next bar unless it is a stop.  I see 2 option based on your reply:

    1. Add a stop:  Can I add the exit/stop as a moving exit (not trailing since i dont want to be limited by the minimum distance required by IG/guaranteed stop)?

    for example: the LongExit is calculated based on an event (EventTrigger).  This normally happens multiple times after I go long, so multiple times the Long Exit will change and it will be near the price.

    2. can you elaborate on the mulitframe. thanks.

    #154709

    SET orders are placed on the market at the open of a candle and remain there until cancelled or their distance is changed by another SET order or until they are hit by price.

    Pending STOP and LIMIT orders have to be placed at the close of every bar (and are applied at the open of the next bar) because they last for one bar only.

    Multi time frame allows you to make decisions on say a 1 hour time frame but then control the trade on say a 1 minute time frame so you can adjust your orders regularly at the close of every minute throughout the hour candle. Using MTF does however limit the data available to back test on as faster time frames cover a shorter period for the same number of bars.

    Plenty more elaboration on MTF in the sticky topic about it:

    https://www.prorealcode.com/topic/multi-timeframe-mtf-indicators-for-prorealtime/

Viewing 4 posts - 1 through 4 (of 4 total)

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