StopLoss - Last Low Price

Created at 25 Aug 2020, 07:56
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!
RA

raphael.mca@hotmail.com

Joined 16.04.2017

StopLoss - Last Low Price
25 Aug 2020, 07:56


Good night cTrader friends ...

I'm trying to implement a code from my Bot that executes the purchase order, and puts a stop exactly on the low price of the previous candle, and projects a take profit of 1.5.

But I'm having a hard time doing this, could someone please help me solve this issue?


@raphael.mca@hotmail.com
Replies

PanagiotisCharalampous
25 Aug 2020, 08:03

Hi Raphael,

See an example below

           var position = ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 1000).Position;
           position.ModifyStopLossPrice(Bars.Last(1).Low);
           var takeProfit = position.EntryPrice + ((position.EntryPrice - position.StopLoss) * 1.5);
           position.ModifyTakeProfitPrice(takeProfit);

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

raphael.mca@hotmail.com
26 Aug 2020, 19:25

RE:

PanagiotisCharalampous said:

Hi Raphael,

See an example below

           var position = ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 1000).Position;
           position.ModifyStopLossPrice(Bars.Last(1).Low);
           var takeProfit = position.EntryPrice + ((position.EntryPrice - position.StopLoss) * 1.5);
           position.ModifyTakeProfitPrice(takeProfit);

Best Regards,

Panagiotis 

Join us on Telegram

 

 

 

Thank you very much my friend ... it worked perfectly!


@raphael.mca@hotmail.com