hey guys why if i use this TMF function for profit lock, nothing happen? where i am wrong? thank you

int lock()
{
if( TradeIsOpen && TradePriceClose==TradePriceOpen+30*PIP )
TradeStopLimit = TradePriceOpen+10*PIP;
plot("Stop",TradeStopLimit,MAIN,BLACK);
return 0;
}