Help with setting exit at end of day if profit otherwise sell after 5 days

Forums ProRealTime English forum ProOrder support Help with setting exit at end of day if profit otherwise sell after 5 days

Viewing 3 posts - 1 through 3 (of 3 total)
  • #15813

    Hi, i wanna create a really simple exit strategy for stocks and apply it to some other simple strategies i am trying out with stocks.

    What i want to do is create a exit strategy that exits the position if the position is in profit 5 minutes before market closing. It should keep doing this for 4 days and on the 5th day sell either way (despite being in loss) 5 minute before market closes.

    Here is a simple strategy for entering stochastics (2,3) on 30 and exit at 70 (and short the opposite). Now i want to add in the above exit strategy. What code do i write?

    I appreciate any help and tips. I am quite new to prorealtime so i am very open to critique and learning.

    Regards,

    Jolln

    #31844

    Hi

    Did you sort this ?

    I also want to exit the firt day in profit in the end of the day if possible

    Now my algo exit the first bar in profit instantly with this code

    if longonmarket and (barindex=tradeindex+5 or close > tradeprice) then
    sell at market

     

    #32401

    Because codes are only read once at Close of the bar, and if you are using this code on a daily timeframe, it is not possible to make it do things before the end of the day.  Until we get the multitimeframe support, I do not see any accurate solution I’m sorry!

    1 user thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

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