Set a target profit of x €,$ (in the currency of the instrument).
Syntax:
1 |
SET TARGET $PROFIT x |
Example :
1 2 3 4 5 6 7 8 9 |
myMACD = MACD[12,26,9](close) long = myMACD crosses over 0 IF NOT LongOnMarket AND long THEN BUY 1 CONTRACTS AT MARKET ENDIF //set profit target at 100$ SET TARGET $PROFIT 100 |
Nicolas is there any solution to create a Profit Target or Limit eg. 10 pips/points on the basket of trades NOT using the Market Order for IG?
The best I can come up with is:
if ONMARKET THEN
SELL AT positionprice+(0.001*pointvalue) LIMIT // 10pips
ENDIF
You should code it like this instead:
if ONMARKET THEN
SELL AT positionprice+10*pointvalue LIMIT // 10pips
ENDIF
Nicolas thanks for the suggestion that’s what I tried first (because that what I thought too) but it doesn’t work. In the Order List it get’s Rejected with the following message. “The limit level you have requested is too far from the current market level. The maximum limit distance from the current market level for this market is 9973.350 per point”. The entry price in the screen shot on Order List says 2.32711 IG markets transaction list says 1.32965. It doesn’t make sense?
link to screeenshot
Please open a new topic in ProOrder support for that specific problem.
Can $profit be used independently, not together with SET TARGET? If not could you share the code to calculate profit in dollar values of the current position? The position could be constantly increasing and the entry price is different for each position.
oh. I figured it out to be (close-tradeprice)/pointsize*pointvalue*countoflongshares. Is it correct?