Hi, I would like to programme the following, perhaps someone has done it already. I would like to buy one contract if price is greater than the bar open. But I want probuilder to place a buy stop order and a stop order at the same time. I do not want to buy at market, I want to buy at a level higher than where the market is trading, hence a buy stop. Can anyone help me with the code for that? Thanks in advance
Topic moved to ProOrder support (automated trading related).
About your request, let’s say you want to buy at Close plus 5 points above this level, only if the current bar has closed above the open:
1
2
3
4
5
defparamcumulateorders=false
ifclose>openthen
BUY1SHAREATclose+5*pointsize
endif
This code will be read and executed once at bar close, the stop order will remain only 1 bar. The condition will be tested again at next bar Close. Hope it helps, let us know.
Thanks for the reply. Is there anyone you can recommend who can programme an entire trading system for me? I sent a request via the website and am awaiting a reply.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue