Dear all,
I am new with prorealcode, can somebody help me to Modify a Stop order?
For example: BUY 1 CONTRACTS AT x Stop. I want to change it from price ‘x’ to price ‘x+y’. And stop loss, take profit too.
I have searched about this but got no luck. Then I tried to Cancel that Stop order and open with new order to work around but no luck too
Can somebody help me please
Thank you in advance!
i belive what you want is something like this
c1 = average[5](close) crosses over average[10](close)
y = close - 50
if c1 then
buy 1 contract at y limit
endif
The buy condition is just an example. Point is that y = your price where you want to buy, which would be (price – 50).
Im pretty sure im correct but if someone tells me im wrong im not gonna argue 😀
You can’t modify a pending order, they last during one period. You have to continuously put them at market (on each bar) and change their price levels that way.
I want to change it from price ‘x’ to price ‘x+y’.
Why don’t you post on here what code you have / use currently and state in words (or pseudocode) what you want the code to do and then you will likely get an amended version code by folk on here.
Above will make it easy for us to help you. 🙂
Thank you @jebus89. But ‘buy 1 contract at y limit’ this y is fixed, right? I just want y can be modified, for example: Now I set it at price X but 10 minutes later if this pending order is not triggered, I can change the price to trigger to X+Y
Thank @Nicolas. I see
Hi @GraHal. I just want to change like this:
For example: Now I set it at price X but 10 minutes later if this pending order is not triggered, I can change the price to trigger to X+Y
This in MQL5 we can do easy. Hope prorealcode can support
You can set Y to 0 initially, then increment it whenever some conditions of your are true, then clear it again whenever you want.