Aries Sekawan
New Member
- Credits
- 0
halo para guru,,,
saya sudah belajar buat coding Button BUY, SELL dan CLOSE.
Bisa Tolong di bantu buatin Fungsinya ga guru,,,
Uda coba googling, tapi ga ketemu.
saya sudah belajar buat coding Button BUY, SELL dan CLOSE.
Bisa Tolong di bantu buatin Fungsinya ga guru,,,
Uda coba googling, tapi ga ketemu.
Code:
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#define BUTTON_CLOSE "Button Close"
#define BUTTON_BUY "Button Buy"
#define BUTTON_SELL "Button Sell"
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
ObjectCreate (0,BUTTON_CLOSE,OBJ_BUTTON,0,0,0);
ObjectSetInteger (0,BUTTON_CLOSE,OBJPROP_XSIZE,50);
ObjectSetInteger (0,BUTTON_CLOSE,OBJPROP_YSIZE,25);
ObjectSetInteger (0,BUTTON_CLOSE,OBJPROP_XDISTANCE,10);
ObjectSetInteger (0,BUTTON_CLOSE,OBJPROP_YDISTANCE,15);
ObjectSetInteger (0,BUTTON_CLOSE,OBJPROP_COLOR,clrWhite);
ObjectSetInteger (0,BUTTON_CLOSE,OBJPROP_BGCOLOR,clrGold);
ObjectSetString (0,BUTTON_CLOSE,OBJPROP_TEXT,"CLOSE");
ObjectCreate (0,BUTTON_BUY,OBJ_BUTTON,0,0,0);
ObjectSetInteger (0,BUTTON_BUY,OBJPROP_XSIZE,50);
ObjectSetInteger (0,BUTTON_BUY,OBJPROP_YSIZE,25);
ObjectSetInteger (0,BUTTON_BUY,OBJPROP_XDISTANCE,70);
ObjectSetInteger (0,BUTTON_BUY,OBJPROP_YDISTANCE,15);
ObjectSetInteger (0,BUTTON_BUY,OBJPROP_COLOR,clrWhite);
ObjectSetInteger (0,BUTTON_BUY,OBJPROP_BGCOLOR,clrBlue);
ObjectSetString (0,BUTTON_BUY,OBJPROP_TEXT,"BUY");
ObjectCreate (0,BUTTON_SELL,OBJ_BUTTON,0,0,0);
ObjectSetInteger (0,BUTTON_SELL,OBJPROP_XSIZE,50);
ObjectSetInteger (0,BUTTON_SELL,OBJPROP_YSIZE,25);
ObjectSetInteger (0,BUTTON_SELL,OBJPROP_XDISTANCE,130);
ObjectSetInteger (0,BUTTON_SELL,OBJPROP_YDISTANCE,15);
ObjectSetInteger (0,BUTTON_SELL,OBJPROP_COLOR,clrWhite);
ObjectSetInteger (0,BUTTON_SELL,OBJPROP_BGCOLOR,clrRed);
ObjectSetString (0,BUTTON_SELL,OBJPROP_TEXT,"SELL");
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}