pending order open price
-
Hello,
I want to set a pending order's open price to be at a given X percentage above or bellow current price, instead of setting a specific amount of pips as price offset.
For example, if current price is 1.1000 and X=2, I want to be able to place a pending order's open price at
1.1000+(0.02*1.1000)= 1.1220.
Thanks in advance for your time. -
See image below.. in the example, a buy limit order will be place 1% below the market (see the "Adjust" field, where it says *(0.99), that means current market price minus 1%).. then you can create a constant with the value you want and choose how far, in %, the order will be from current market price.

-
@moreirajbn
Thank you very much for the answer mate. However I do not understand why do I need to create the constant. In order to be able to change the value more easily? -
If you already have a percentage you will use forever (let's say 1%), then you can just use 0.99 (1% below market) or 1.01 (1% above market) in the Adjust field. However, if you want to optimize it or plan to change it in the future, it will be much more convenient if you have a constant you can change without the need of changing the source code.
Your choice !
Cheers.
-
@moreirajbn
thanks again for the clarification. gonna test it soon.