Many thanks arby1108 for your contribution of efforts. in this the problem I found out is that. by using below header files we .....
i tried with below code. but it is not modifying the SL as expected (We are getting "Invalid Stops" error). please check the below code and check if you can make any changes to it
MqlTick latest_price; // To be used for getting recent/latest price quotes
MqlTradeRequest request = {0};
MqlTradeResult result ={0};
{
if(AccountInfoDouble(ACCOUNT_EQUITY) > max || AccountInfoDouble(ACCOUNT_EQUITY) / AccountInfoDouble(ACCOUNT_BALANCE) < (double) MaxDrawdown / 100)
{
if(rateChangeBid < -VelocityStop * SymbolInfoDouble(_Symbol, SYMBOL_POINT) && latest_price.bid < PositionGetDouble(POSITION_PRICE_OPEN) - (VelocityTrigger * SymbolInfoDouble(_Symbol, SYMBOL_POINT)))
{
if(PositionGetDouble(POSITION_SL) == 0.0 || latest_price.bid - PositionGetDouble(POSITION_SL) > (trail * SymbolInfoDouble(_Symbol, SYMBOL_POINT) * trailLoss))
{
if(NormalizeDouble(latest_price.bid - (trail * SymbolInfoDouble(_Symbol, SYMBOL_POINT) * trailLoss), (int)SymbolInfoInteger(_Symbol, SYMBOL_DIGITS)) != PositionGetDouble(POSITION_SL))
{
// SL1= NormalizeDouble(Bid - (trail * SymbolInfoDouble(_Symbol, SYMBOL_POINT) * trailLoss), (int)SymbolInfoInteger(_Symbol, SYMBOL_DIGITS));
//====================================
ZeroMemory(request);
ZeroMemory(result);
request.action = TRADE_ACTION_SLTP;
// request.order = ticket;
request.position = PosistionTicket;
request.symbol = _Symbol; // symbol
request.sl = NormalizeDouble(latest_price.bid - (trail * SymbolInfoDouble(_Symbol, SYMBOL_POINT) * trailLoss), (int)SymbolInfoInteger(_Symbol, SYMBOL_DIGITS));
request.tp = PositionGetDouble(POSITION_TP);
for(i=0; i

; i++)
{
result.retcode=OrderSend(request,result);
if(result.retcode==10009 || result.retcode==10008) // request executed
Print("Moving Stop Loss of Buy position #",request.order);
else
{
Print(ResultRetcodeDescription(result.retcode));
return;
}
}
return;
//====================================
}