Make the trade at Close

Forums ProRealTime English forum ProOrder support Make the trade at Close

Viewing 5 posts - 1 through 5 (of 5 total)
  • #124283

    I tried to create a system based on:

    Buy if Stochastic Fast (2) is less than 10. Sell if Stochastic Fast (2) is greater than 50. When I tried this I saw that the system entered the position the day after instead of at Close. I guess this is an easy fix but I’m not sure how to do it myself. Just to be clear, I want the system to buy the stock at Close if Stochastic Fast (2) go below 10.

    The same would go for this system:

    Buy at Close if Stochastic Slow (2) go below 30. Sell at Close if Stochastic Slow (2) is greater than 70.

    Thank you, kind regards Sebastian

    #124284

    Welcome to the forums – this question has been asked many times before. PRT runs through the code at the close of a candle. If the strategy decides to open a trade then orders are sent to the broker and the orders are carried out or placed on the market at the opening of the following candle.

    If you want to open a trade at 10:59:59 instead of at 11:00:00 then you will have to code something using MTF. There are examples and discussions about this that I am sure you will find if you use the search box. The disadvantage of using MTF is that you will have massively less data to back test on as your strategy will have to be run on the fastest time frame.

    #124302

    Just to make sure, you say I have to run at the fastest time frame but my strategy is based on “Day” (not 5 minutes, not 1 hour….). With that said, is it possible to use the Stochastic indicator on the Day-time frame but still have the system to open the trade at let say 17.23 (Swedish time)? If so I will for sure search for MTF in the forum.

    Kind regards, Sebastian

    #124304

    Yes. With MTF you can make decisions on say the daily time frame and based on indicators applied on the daily time frame but make the entry in a faster time frame. There are some issues to consider however – for example if you use the 1 second time frame if there is no 1 second candle then your strategy will not open a trade. Also as said before you get a lot less data to back test on.

    I wrote some code for someone else a while back that did this and also kept trying to enter the market for a few seconds rather than just for one second. I can’t find the topic right now but if I do I’ll put  a link here.

    #124313

    I can’t find the topic that I was thinking of unfortunately but these two might be of help:

    https://www.prorealcode.com/topic/help-take-pos-quickly/

    https://www.prorealcode.com/topic/buy-at-open-sell-at-close/

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

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