Taking profits to early

Created at 04 Nov 2014, 11:05
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JA

jagtrading

Joined 01.10.2014

Taking profits to early
04 Nov 2014, 11:05


Hi guys,

I created a program and it works fine the problem I have is that the robot takes profits to early.

I am using ATR as a multiple to take profit and as you can see above the take profit is 64pips however it takes the profit at 9 pips.

Can someone tell me what is wrong and help me please???

Thank you for help.


@jagtrading
Replies

modarkat
04 Nov 2014, 11:27

You must pass absolute price to the ModifyPosition method.

Example:

            var takeProfitPips = 40;
            var stopLossPips = 20;
            
            var stopLoss = position.TradeType == TradeType.Buy ? position.EntryPrice - stopLossPips * Symbol.PipSize : position.EntryPrice + stopLossPips * Symbol.PipSize;
            var takeProfit = position.TradeType == TradeType.Buy ? position.EntryPrice + stopLossPips * Symbol.PipSize : position.EntryPrice - stopLossPips * Symbol.PipSize;
            ModifyPosition(position, stopLoss, takeProfit);

 


@modarkat