Buy at current bar and not at next bar open

Forums ProRealTime English forum ProOrder support Buy at current bar and not at next bar open

This topic contains 6 replies, has 4 voices, and was last updated by avatar mvajdi 3 years, 10 months ago.

Currently, there are 0 users and 1 guest visiting this topic.
View all attachments
Viewing 7 posts - 1 through 7 (of 7 total)
  • #5664

    Hi, I am fairly new to coding on ProRealCode, I want to initiate a buy/sell not at the next bar open but at the current bar, would be great to have some advice.





    Hello Eugene,

    Unfortunately, it is not possible at the moment to do this. Each condition are tested once a bar. Sorry.

    Do you have any other question about coding? Don’t hesitate to create new topics in forums for specific question about prorealtime coding 🙂


    Thanks Nicolas,

    I am trying to trade 30min, using the bollinger band. Any spikes above the bollinger to take a reversal trade on the same bar, both on the long and short side. Can someone help me see what’s wrong with my code (below)? The backtest does not show the trades according to my thought process. Sometimes it opens where I see the price overshoots the bollinger, and sometimes it does not open a trade where I see the spike.

    Ideally, this strategy uses the same (current) bar to get the signal and to open the trade but not the next open bar.

    Appreciate any help here.





    You are here testing a high spike below the bollinger bands for a long position. You should use “low” in your indicator1 variable in my opinion.

    And use “high” instead of close in indicator5.

    Also, actually you are testing a spike out of the bollinger bands and not a re-entry in them… it maybe filter some bad signals ..

    Your target profit of 1$ is very minimalist and you don’t even exit position in loss, how do you manage that? because there will be some trades that will never be in gain 🙂




    Tks Nicolas,

    Makes a lot of sense, I somehow didi;t see the obvious where there should be a low, for the buy signal and a high for the sell signal.

    I am trying to trade/scalp the current bars, but unfortunately it is only for the next bar open. Is there a way to trigger the execution at the current bar?



    Hi, i developed my code to buy and sell when the price touch MA, i did it with a LIMIT order when conditions are true, when signal is = 1, then the system sets up a limit order  ready to go :). Also works with an STOP order.


    Hope it helps you!



    Hi Adolfo,

    Thank you for sharing your code. I am new in coding and wandered to use your code on  “Perpoint”  instead of “Share” which parts has to be changed?



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

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