(FREE) BDOForex Gold V3.69 - Trend, Né Tin, SL TP Nâng cao. New
Forex Gold Bot - Trend, Né Tin, Chốt Lời, Cắt Lỗ, TP, SL. 🏆 Robot giao dịch vàng được lập trình để tự động giao dịch vàng trên thị trường tài chín…
- Threads
- 1
- Words
- 4157
Forex Gold Bot - Trend, Né Tin, Chốt Lời, Cắt Lỗ, TP, SL. 🏆 Robot giao dịch vàng được lập trình để tự động giao dịch vàng trên thị trường tài chín…
int start()
{
// Get the closing price of the current candle
double currentClose = Close[0];
// Get the opening price of the current candle
double currentOpen = Open[0];
// Check if the current candle is bullish or bearish
bool isBullish = currentClose > currentOpen;
// If the current candle is bullish, open a BUY trade
if (isBullish) {
int ticket = OrderSend(Symbol(), OP_BUY, 0.1, Ask, 0, Bid - StopLoss * Point, Bid + TakeProfit * Point, "Buy Order", 0, 0, Green);
if (ticket > 0) {
Print("Buy order opened successfully. Ticket:", ticket);
} else {
Print("Buy order failed to open. Error code:", GetLastError());
}
}
// If the current candle is bearish, open a SELL trade
else {
int ticket = OrderSend(Symbol(), OP_SELL, 0.1, Bid, 0, Ask + StopLoss * Point, Ask - TakeProfit * Point, "Sell Order", 0, 0, Red);
if (ticket > 0) {
Print("Sell order opened successfully. Ticket:", ticket);
} else {
Print("Sell order failed to open. Error code:", GetLastError());
}
}
return 0;
}
currentClose
and currentOpen
to retrieve the closing and opening prices of the current candle. Then, we check whether the current candle is bullish or bearish by comparing the closing price and the opening price.
OrderSend()
function to open a BUY trade. The OP_BUY
parameter is used to specify the order type as BUY. The Ask
parameter is employed to set the current buying price of the currency pair. The Bid - StopLoss * Point
parameter is used to define the Stop Loss price for the BUY trade. The Bid + TakeProfit * Point
parameter is used to determine the Take Profit price for the BUY trade. OrderSend()
function to open a SELL trade. The OP_SELL
parameter is used to specify the order type as SELL. The Bid
parameter is utilized to set the current selling price of the currency pair. The Ask + StopLoss * Point
parameter is employed to set the Stop Loss price for the SELL trade. The Ask - TakeProfit * Point
parameter is used to define the Take Profit price for the SELL trade. StopLoss
and TakeProfit
variables. Additionally, you can add other conditional checks to determine the opening and closing of trades in your own robot.Usdt WalletUsdt Trc20: TKbahyoCceKSVZNKk46c1hsZFh3aYNPB75
Contact the Admin on Telegram: @TONY_NTP
Ngân Hàng TechcombankNguyen Thanh Phong: 1368 86 999999
After making the payment, please leave your information in the comment section. Thank you.
CloseUsdt WalletUsdt Trc20: TKbahyoCceKSVZNKk46c1hsZFh3aYNPB75
Liên Hệ Admin qua Telegram: @TONY_NTP
Ngân Hàng TechcombankNguyen Thanh Phong: 1368 86 999999
Sau khi thanh toán, vui lòng để lại thông tin của bạn trong phần bình luận. Cảm ơn.
Close
image quote pre code