Em viết Script thế này thì có gì sai bác:
//+------------------------------------------------------------------+
//| TP Price.mq4 |
//| Copyright 2023, MetaQuotes Software Corp. |
//|
https://www.mql5.com |
//+------------------------------------------------------------------+
property copyright "Copyright 2023, MetaQuotes Software Corp."
property link "
https://www.mql5.com"
property version "1.00"
property strict
property script_show_inputs
//--- input parameters
input double GiaTP;
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
int ticket = OrderTicket();
if (ticket < 0)
{
Print("Khong tim thay lenh dang mo.");
return;
}
if (!OrderModify(ticket, OrderClosePrice(), OrderStopLoss(), GiaTP, 0, clrNONE))
{
Print("Khong the chinh sua gia TP cho lenh.");
return;
}
}
//+------------------------------------------------------------------+