Help With Code Please – Buy when the current price is higher than last close

Forums ProRealTime English forum ProBuilder support Help With Code Please – Buy when the current price is higher than last close

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

    Hello, I would be extremely grateful if somebody could please provide me with help for a line of code. My code thus far is built for a 2 hourly chart and enters a buy when a new candle opens and the current price is above the Parabolic sar indicator, above the 20 day moving average & above the 50 day moving average. I want to add an additional line of code so the ‘buy’ only executes when all the above conditions are met  & if the current price is higher 2 minutes after the new candle opens than the closing price of the last candle. Can anybody help please?

    #14308

    All conditions can be coded except the last one about the “current price is higher 2 minutes after the new candle opens than the closing price of the last candle” , which is impossible because code are only executed once at the bar close.

    How do you want to adapt your strategy?

    #14432

    Thanks for your help Nicolas it’s greatly appreciated.

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