symbol.ask and pensing order

Created at 08 Aug 2023, 12:37
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!
LU

luca.tocchi

Joined 25.03.2020

symbol.ask and pensing order
08 Aug 2023, 12:37


 PlaceStopOrder(TradeType.Buy, SymbolName,  volumeInUnits, Symbol.Bid + 0.0003, "Ordine");
            
               foreach (var order in PendingOrders)
               {
                   if (order.Label == "Ordine")
                   {
                       if(Symbol.Ask> 12*order.StopLimitRangePips)
                       {
                        double newPrice = Symbol.Ask + 5 * Symbol.PipSize;
                        ModifyPendingOrder(order, Symbol.Bid + 0.0003, null,20);
                        //metto il tp a 20 pips
                       }
                   }
               }

I want that when the price exceeds the entry price of the placestoporder by 12 pips, the placestoporder is changed

I'm using 12*order.StopLimitRangePips but I think is wrong

 

thanks

 


@luca.tocchi
Replies

PanagiotisChar
09 Aug 2023, 05:28

Hi there,

It's wrong. Try

                foreach (var order in PendingOrders)
                {
                   if (order.Label == "Ordine")
                   {
                       if(Symbol.Ask> order.TargetPrice + (Symbol.PipSize * 12))
                       {
                        double newPrice = Symbol.Ask + 5 * Symbol.PipSize;
                        ModifyPendingOrder(order, Symbol.Bid + 0.0003, null,20);
                        //metto il tp a 20 pips
                       }
                   }
                }

Aieden Technologies

Need help? Join us on Telegram


@PanagiotisChar