1. Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)
    Dismiss Notice

Suggestion EA Trade Manager by Riki Romansyah

Discussion in 'Belajar MQL dari Nol' started by Riki Romansyah, 04 Sep 2023.

  1. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 001
    Hi... ini adalah Thread Jurnal ku, kedepan aku akan mencoba menuangkan ide-ideku kedalam sebuah EA untuk mempermudah riset dalam tradingku, aku akan memcoba membuat EA dari nol untuk melihat sejauh mana kemampuan kodingku.
     
    • Like Like x 2
  2. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 002
    Open MetaEditor MT4
    klik File->New->Expert Advisor(template)
    Tampilan Coding masih kosong [default], Next history aku coba membuat sebuah dashboard sederhana...
    //+------------------------------------------------------------------+
    //| EA Trade Manager.mq4 |
    //| Copyright 2023, MetaQuotes Ltd. |
    //| https://www.mql4.com |
    //+------------------------------------------------------------------+
    #property copyright "Copyright 2023, Riki Romansyah."
    #property link "https://soehoe.id/ea-trade-manager-by-riki-romansyah.t29534/"
    #property version "1.00"
    #property strict
    //+------------------------------------------------------------------+
    //| Expert initialization function |
    //+------------------------------------------------------------------+
    int OnInit()
    {
    //--- create timer
    EventSetTimer(60);

    //---
    return(INIT_SUCCEEDED);
    }
    //+------------------------------------------------------------------+
    //| Expert deinitialization function |
    //+------------------------------------------------------------------+
    void OnDeinit(const int reason)
    {
    //--- destroy timer
    EventKillTimer();

    }
    //+------------------------------------------------------------------+
    //| Expert tick function |
    //+------------------------------------------------------------------+
    void OnTick()
    {
    //---

    }
    //+------------------------------------------------------------------+
    //| Timer function |
    //+------------------------------------------------------------------+
    void OnTimer()
    {
    //---

    }
    //+------------------------------------------------------------------+
    //| ChartEvent function |
    //+------------------------------------------------------------------+
    void OnChartEvent(const int id,
    const long &lparam,
    const double &dparam,
    const string &sparam)
    {
    //---

    }
    //+------------------------------------------------------------------+
     
  3. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 003
    Tahap persiapan aku buat dulu Function untuk membuat dashboar , aku tulis dibawah coding post 002
    //+------------------------------------------------------------------+
    //| function SetPanel |
    //+------------------------------------------------------------------+
    void SetPanel(string name,int sub_window,int x,int y,int width,int height,color bg_color,color border_clr,int border_width)
    {
    ObjectDelete(name);
    if(ObjectCreate(0,name,OBJ_RECTANGLE_LABEL,sub_window,0,0))
    {
    ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
    ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
    ObjectSetInteger(0,name,OBJPROP_XSIZE,width);
    ObjectSetInteger(0,name,OBJPROP_YSIZE,height);
    ObjectSetInteger(0,name,OBJPROP_COLOR,border_clr);
    ObjectSetInteger(0,name,OBJPROP_BORDER_TYPE,BORDER_FLAT);
    ObjectSetInteger(0,name,OBJPROP_WIDTH,border_width);
    ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_LEFT_UPPER);
    ObjectSetInteger(0,name,OBJPROP_STYLE,STYLE_SOLID);
    ObjectSetInteger(0,name,OBJPROP_BACK,true);
    ObjectSetInteger(0,name,OBJPROP_SELECTABLE,0);
    ObjectSetInteger(0,name,OBJPROP_SELECTED,0);
    ObjectSetInteger(0,name,OBJPROP_HIDDEN,true);
    ObjectSetInteger(0,name,OBJPROP_ZORDER,0);
    }
    ObjectSetInteger(0,name,OBJPROP_BGCOLOR,bg_color);
    }
    //+------------------------------------------------------------------+
     
  4. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 004
    Masih Tahap Persiapan, aku buat array untuk pair,mata uang dan timeperiod untuk alat bantu nanti pembuatan dashboard,
    juga aku buat sebuah struktur untuk menampung informasi pair trading [28] biji
    //+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    //| Expert initialization Array |
    //+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    string TradePairs[] = {"AUDCAD","AUDCHF","AUDJPY","AUDNZD","AUDUSD","CADCHF","CADJPY","CHFJPY","EURAUD","EURCAD","EURCHF","EURGBP","EURJPY","EURNZD","EURUSD","GBPAUD","GBPCAD","GBPCHF","GBPJPY","GBPNZD","GBPUSD","NZDCAD","NZDCHF","NZDJPY","NZDUSD","USDCAD","USDCHF","USDJPY"};
    string curr[8] = {"USD","EUR","GBP","JPY","AUD","NZD","CAD","CHF"};
    string Periode[9]={"M1","M5","M15","M30","H1","H4","D1","W1","MN1"};
    //+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    struct signal{
    string pair;
    double spread;
    int digit;
    }; signal signals[28];
     
  5. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 005
    Tahap Awal Dasboard akan Seperti ini
    Screenshot_1.jpg
    //+------------------------------------------------------------------+
    //| EA Trade Manager.mq4 |
    //| Copyright 2023, MetaQuotes Ltd. |
    //| https://www.mql4.com |
    //+------------------------------------------------------------------+
    #property copyright "Copyright 2023, Riki Romansyah."
    #property link "https://soehoe.id/ea-trade-manager-by-riki-romansyah.t29534/"
    #property version "1.00"
    #property strict
    #define Develover "Riki Romansyah"
    #define EAVersion "1.0"
    //+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    //| Expert initialization Array |
    //+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    string TradePairs[] = {"AUDCAD","AUDCHF","AUDJPY","AUDNZD","AUDUSD","CADCHF","CADJPY","CHFJPY","EURAUD","EURCAD","EURCHF","EURGBP","EURJPY","EURNZD","EURUSD","GBPAUD","GBPCAD","GBPCHF","GBPJPY","GBPNZD","GBPUSD","NZDCAD","NZDCHF","NZDJPY","NZDUSD","USDCAD","USDCHF","USDJPY"};
    string curr[8] = {"USD","EUR","GBP","JPY","AUD","NZD","CAD","CHF"};
    string Periode[9]={"M1","M5","M15","M30","H1","H4","D1","W1","MN1"};
    //+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    struct signal{
    string pair;
    double spread;
    int digit;
    }; signal signals[28];

    sinput string ID_set_Panels = "MANAGEMENT EA - Posisi"; // =================================
    int x_axis = 0;
    int y_axis = 0;


    //+------------------------------------------------------------------+
    //| Expert initialization function |
    //+------------------------------------------------------------------+
    int OnInit()
    {

    //Pembuatan Panel
    SetPanel("DashboardPanel",0,x_axis+3,y_axis+13,1024,25,C'30,30,30',C'61,61,61',1);
    SetText("txtPAutoTrading","EA Trade Manager : "+(string)EAVersion,x_axis+10,y_axis+15,clrSilver,10);
    SetPanel("SubDashboardPanel",0,x_axis+3,y_axis+43,1024,415,C'30,30,30',C'61,61,61',1);

    for(int i=0;i<ArraySize(TradePairs);i++){
    signals.pair=TradePairs;
    signals.digit=(int) MarketInfo(TradePairs ,MODE_DIGITS);
    }
    SetPanel("PanelHeadPair",0,x_axis+5,y_axis+45,50,15,clrGoldenrod,C'61,61,61',1);
    SetText("TextPanelHeadPair","Pair",x_axis+8,y_axis+45,clrBlack,8);
    for(int i=0;i<ArraySize(TradePairs);i++){
    SetPanel("PanelsPair"+(string)i,0,x_axis+5,y_axis+62+(i*14),50,13,C'30,30,30',C'61,61,61',1);
    SetText("TextsPair"+(string)i,(string)TradePairs,x_axis+8,y_axis+62+(i*14),clrWhite,8);
    }
    EventSetTimer(60);

    //---
    return(INIT_SUCCEEDED);
    }
    //+------------------------------------------------------------------+
    //| Expert deinitialization function |
    //+------------------------------------------------------------------+
    void OnDeinit(const int reason)
    {
    //--- destroy timer
    EventKillTimer();

    }
    //+------------------------------------------------------------------+
    //| Expert tick function |
    //+------------------------------------------------------------------+
    void OnTick()
    {
    //---

    }
    //+------------------------------------------------------------------+
    //| Timer function |
    //+------------------------------------------------------------------+
    void OnTimer()
    {
    //---

    }
    //+------------------------------------------------------------------+
    //| ChartEvent function |
    //+------------------------------------------------------------------+
    void OnChartEvent(const int id,
    const long &lparam,
    const double &dparam,
    const string &sparam)
    {
    //---

    }
    //+------------------------------------------------------------------+

    //+------------------------------------------------------------------+
    //| function SetPanel |
    //+------------------------------------------------------------------+
    void SetPanel(string name,int sub_window,int x,int y,int width,int height,color bg_color,color border_clr,int border_width)
    {
    ObjectDelete(name);
    if(ObjectCreate(0,name,OBJ_RECTANGLE_LABEL,sub_window,0,0))
    {
    ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
    ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
    ObjectSetInteger(0,name,OBJPROP_XSIZE,width);
    ObjectSetInteger(0,name,OBJPROP_YSIZE,height);
    ObjectSetInteger(0,name,OBJPROP_COLOR,border_clr);
    ObjectSetInteger(0,name,OBJPROP_BORDER_TYPE,BORDER_FLAT);
    ObjectSetInteger(0,name,OBJPROP_WIDTH,border_width);
    ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_LEFT_UPPER);
    ObjectSetInteger(0,name,OBJPROP_STYLE,STYLE_SOLID);
    ObjectSetInteger(0,name,OBJPROP_BACK,true);
    ObjectSetInteger(0,name,OBJPROP_SELECTABLE,0);
    ObjectSetInteger(0,name,OBJPROP_SELECTED,0);
    ObjectSetInteger(0,name,OBJPROP_HIDDEN,true);
    ObjectSetInteger(0,name,OBJPROP_ZORDER,0);
    }
    ObjectSetInteger(0,name,OBJPROP_BGCOLOR,bg_color);
    }
    //+------------------------------------------------------------------+
    void SetText(string name,string text,int x,int y,color colour,int fontsize=12)
    {
    ObjectDelete(name);
    if (ObjectFind(0,name)<0)
    ObjectCreate(0,name,OBJ_LABEL,0,0,0);

    ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
    ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
    ObjectSetInteger(0,name,OBJPROP_COLOR,colour);
    ObjectSetInteger(0,name,OBJPROP_FONTSIZE,fontsize);
    ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_LEFT_UPPER);
    ObjectSetString(0,name,OBJPROP_TEXT,text);
    ObjectSetString(0,name,OBJPROP_FONT,"Segoe UI");
    ObjectSetInteger(0,name,OBJPROP_SELECTABLE,0);
    ObjectSetInteger(0,name,OBJPROP_SELECTED,0);
    }

    void EditText(string name,string text,color fontcolor,int fontsize) {
    ObjectSetString(0,name,OBJPROP_TEXT,text);
    ObjectSetInteger(0,name,OBJPROP_COLOR,fontcolor);
    ObjectSetInteger(0,name,OBJPROP_FONTSIZE,fontsize);
    }

    void SetButton(string but_name,string label,int xsize,int ysize,int xdist,int ydist,int bcolor,int fcolor,int textFont)
    {

    if(ObjectFind(0,but_name)<0)
    {
    if(!ObjectCreate(0,but_name,OBJ_BUTTON,0,0,0))
    {
    Print(__FUNCTION__,
    ": failed to create the button! Error code = ",GetLastError());
    return;
    }
    ObjectSetString(0,but_name,OBJPROP_TEXT,label);
    ObjectSetInteger(0,but_name,OBJPROP_XSIZE,xsize);
    ObjectSetInteger(0,but_name,OBJPROP_YSIZE,ysize);
    ObjectSetInteger(0,but_name,OBJPROP_CORNER,CORNER_LEFT_UPPER);
    ObjectSetInteger(0,but_name,OBJPROP_XDISTANCE,xdist);
    ObjectSetInteger(0,but_name,OBJPROP_YDISTANCE,ydist);
    ObjectSetInteger(0,but_name,OBJPROP_BGCOLOR,bcolor);
    ObjectSetInteger(0,but_name,OBJPROP_COLOR,fcolor);
    ObjectSetInteger(0,but_name,OBJPROP_FONTSIZE,textFont);
    ObjectSetInteger(0,but_name,OBJPROP_HIDDEN,true);

    ObjectSetInteger(0,but_name,OBJPROP_BORDER_TYPE,BORDER_FLAT);

    ChartRedraw();
    }

    }
     

    Attached Files:

  6. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 006
    Untuk memantau forex dari sudut terluas, aku mulai dari menampilkan spread semua pair, Let's Go
    Screenshot_2.jpg
    //+------------------------------------------------------------------+
    //| EA Trade Manager.mq4 |
    //| Copyright 2023, MetaQuotes Ltd. |
    //| https://www.mql4.com |
    //+------------------------------------------------------------------+
    #property copyright "Copyright 2023, Riki Romansyah."
    #property link "https://soehoe.id/ea-trade-manager-by-riki-romansyah.t29534/"
    #property version "1.00"
    #property strict
    #define Develover "Riki Romansyah"
    #define EAVersion "1.0"
    //+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    //| Expert initialization Array |
    //+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    string TradePairs[] = {"AUDCAD","AUDCHF","AUDJPY","AUDNZD","AUDUSD","CADCHF","CADJPY","CHFJPY","EURAUD","EURCAD","EURCHF","EURGBP","EURJPY","EURNZD","EURUSD","GBPAUD","GBPCAD","GBPCHF","GBPJPY","GBPNZD","GBPUSD","NZDCAD","NZDCHF","NZDJPY","NZDUSD","USDCAD","USDCHF","USDJPY"};
    string curr[8] = {"USD","EUR","GBP","JPY","AUD","NZD","CAD","CHF"};
    string Periode[9]={"M1","M5","M15","M30","H1","H4","D1","W1","MN1"};
    //+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    struct signal{
    string pair;
    double spread;
    int digit;
    }; signal signals[28];

    sinput string ID_set_Panels = "MANAGEMENT EA - Posisi"; // =================================
    int x_axis = 0;
    int y_axis = 0;
    sinput double Spread_Trigger = 2.5;


    //+------------------------------------------------------------------+
    //| Expert initialization function |
    //+------------------------------------------------------------------+
    int OnInit()
    {

    //Pembuatan Panel
    SetPanel("DashboardPanel",0,x_axis+3,y_axis+13,1024,25,C'30,30,30',C'61,61,61',1);
    SetText("txtPAutoTrading","EA Trade Manager : "+(string)EAVersion,x_axis+10,y_axis+15,clrSilver,10);
    SetPanel("SubDashboardPanel",0,x_axis+3,y_axis+43,1024,415,C'30,30,30',C'61,61,61',1);

    for(int i=0;i<ArraySize(TradePairs);i++){
    signals.pair=TradePairs;
    signals.digit=(int) MarketInfo(TradePairs ,MODE_DIGITS);
    }
    SetPanel("PanelHeadPair",0,x_axis+5,y_axis+45,50,15,clrGoldenrod,C'61,61,61',1);
    SetText("TextPanelHeadPair","Pair",x_axis+8,y_axis+45,clrBlack,8);

    SetPanel("HeadSpread",0,x_axis+56,y_axis+45,45,15,clrGoldenrod,C'61,61,61',1);
    SetText("TextHeadSpread","Spread",x_axis+57,y_axis+45,clrBlack,8);

    for(int i=0;i<ArraySize(TradePairs);i++){
    SetPanel("PanelsPair"+(string)i,0,x_axis+5,y_axis+62+(i*14),50,13,C'30,30,30',C'61,61,61',1);
    SetText("TextsPair"+(string)i,(string)TradePairs,x_axis+8,y_axis+62+(i*14),clrWhite,8);
    SetPanel("PanelSpread"+(string)i,0,x_axis+56,y_axis+62+(i*14),45,15,clrGoldenrod,C'61,61,61',1);
    SetText("TextSpread"+(string)i,"0.0",x_axis+60,y_axis+62+(i*14),clrBlack,8);
    }
    EventSetTimer(1);

    //---
    return(INIT_SUCCEEDED);
    }
    //+------------------------------------------------------------------+
    //| Expert deinitialization function |
    //+------------------------------------------------------------------+
    void OnDeinit(const int reason)
    {
    //--- destroy timer
    EventKillTimer();

    }
    //+------------------------------------------------------------------+
    //| Expert tick function |
    //+------------------------------------------------------------------+
    void OnTick()
    {
    //---

    }
    void GetSpread(){
    color clrSpread= clrBlack;
    for (int i=0;i<ArraySize(TradePairs);i++){
    signals.spread=MarketInfo(TradePairs,MODE_SPREAD)/10;
    if(signals.spread>=Spread_Trigger){
    clrSpread=clrRed;
    }else{
    clrSpread=clrBlack;
    }
    EditText("TextSpread"+(string)i,DoubleToString(signals.spread,1),clrSpread,8);
    }
    }
    //+------------------------------------------------------------------+
    //| Timer function |
    //+------------------------------------------------------------------+
    void OnTimer()
    {
    //---
    GetSpread();
    }
    //+------------------------------------------------------------------+
    //| ChartEvent function |
    //+------------------------------------------------------------------+
    void OnChartEvent(const int id,
    const long &lparam,
    const double &dparam,
    const string &sparam)
    {
    //---

    }
    //+------------------------------------------------------------------+

    //+------------------------------------------------------------------+
    //| function SetPanel |
    //+------------------------------------------------------------------+
    void SetPanel(string name,int sub_window,int x,int y,int width,int height,color bg_color,color border_clr,int border_width)
    {
    ObjectDelete(name);
    if(ObjectCreate(0,name,OBJ_RECTANGLE_LABEL,sub_window,0,0))
    {
    ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
    ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
    ObjectSetInteger(0,name,OBJPROP_XSIZE,width);
    ObjectSetInteger(0,name,OBJPROP_YSIZE,height);
    ObjectSetInteger(0,name,OBJPROP_COLOR,border_clr);
    ObjectSetInteger(0,name,OBJPROP_BORDER_TYPE,BORDER_FLAT);
    ObjectSetInteger(0,name,OBJPROP_WIDTH,border_width);
    ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_LEFT_UPPER);
    ObjectSetInteger(0,name,OBJPROP_STYLE,STYLE_SOLID);
    ObjectSetInteger(0,name,OBJPROP_BACK,true);
    ObjectSetInteger(0,name,OBJPROP_SELECTABLE,0);
    ObjectSetInteger(0,name,OBJPROP_SELECTED,0);
    ObjectSetInteger(0,name,OBJPROP_HIDDEN,true);
    ObjectSetInteger(0,name,OBJPROP_ZORDER,0);
    }
    ObjectSetInteger(0,name,OBJPROP_BGCOLOR,bg_color);
    }
    //+------------------------------------------------------------------+
    void SetText(string name,string text,int x,int y,color colour,int fontsize=12)
    {
    ObjectDelete(name);
    if (ObjectFind(0,name)<0)
    ObjectCreate(0,name,OBJ_LABEL,0,0,0);

    ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
    ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
    ObjectSetInteger(0,name,OBJPROP_COLOR,colour);
    ObjectSetInteger(0,name,OBJPROP_FONTSIZE,fontsize);
    ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_LEFT_UPPER);
    ObjectSetString(0,name,OBJPROP_TEXT,text);
    ObjectSetString(0,name,OBJPROP_FONT,"Segoe UI");
    ObjectSetInteger(0,name,OBJPROP_SELECTABLE,0);
    ObjectSetInteger(0,name,OBJPROP_SELECTED,0);
    }

    void EditText(string name,string text,color fontcolor,int fontsize) {
    ObjectSetString(0,name,OBJPROP_TEXT,text);
    ObjectSetInteger(0,name,OBJPROP_COLOR,fontcolor);
    ObjectSetInteger(0,name,OBJPROP_FONTSIZE,fontsize);
    }

    void SetButton(string but_name,string label,int xsize,int ysize,int xdist,int ydist,int bcolor,int fcolor,int textFont)
    {

    if(ObjectFind(0,but_name)<0)
    {
    if(!ObjectCreate(0,but_name,OBJ_BUTTON,0,0,0))
    {
    Print(__FUNCTION__,
    ": failed to create the button! Error code = ",GetLastError());
    return;
    }
    ObjectSetString(0,but_name,OBJPROP_TEXT,label);
    ObjectSetInteger(0,but_name,OBJPROP_XSIZE,xsize);
    ObjectSetInteger(0,but_name,OBJPROP_YSIZE,ysize);
    ObjectSetInteger(0,but_name,OBJPROP_CORNER,CORNER_LEFT_UPPER);
    ObjectSetInteger(0,but_name,OBJPROP_XDISTANCE,xdist);
    ObjectSetInteger(0,but_name,OBJPROP_YDISTANCE,ydist);
    ObjectSetInteger(0,but_name,OBJPROP_BGCOLOR,bcolor);
    ObjectSetInteger(0,but_name,OBJPROP_COLOR,fcolor);
    ObjectSetInteger(0,but_name,OBJPROP_FONTSIZE,textFont);
    ObjectSetInteger(0,but_name,OBJPROP_HIDDEN,true);

    ObjectSetInteger(0,but_name,OBJPROP_BORDER_TYPE,BORDER_FLAT);

    ChartRedraw();
    }

    }
     

    Attached Files:

  7. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 007
    Hal Dasar, jangan lupa di show all di market watch ctrl + m
    Screenshot_3.jpg
     
  8. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 008
    Next Mission kita Tambah Daily Percent dari setiap pair untuk memantau forex dari sudut terluas, Let's Go
    Screenshot_4.jpg
     

    Attached Files:

  9. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 009
    Next Mission aku Tambah Fibonacci agar lebih ber KELAS kaya orang barat sana ^_^,, Let's Go
    Screenshot_1.jpg
     

    Attached Files:

  10. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 010
    Next Mission aku Tambah CANDLE DIRECTION agar lebih ber KELAS kaya orang barat juga ^_^, gak boleh kalah saing, Let's Go
    Screenshot_10.jpg

    Codingnya :
    void GetDirection(){
    for (int i=0;i<ArraySize(TradePairs);i++){
    //M1
    if(iClose(TradePairs, PERIOD_M1,1)<iOpen(TradePairs, PERIOD_M1,0)){signals.Dir0=0;}else
    if(iClose(TradePairs, PERIOD_M1,1)>iOpen(TradePairs, PERIOD_M1,0)){signals.Dir0=1;}else
    {signals.Dir0=2;}
    //M5
    if(iClose(TradePairs, PERIOD_M5,1)<iOpen(TradePairs, PERIOD_M5,0)){signals.Dir1=0;}else
    if(iClose(TradePairs, PERIOD_M5,1)>iOpen(TradePairs, PERIOD_M5,0)){signals.Dir1=1;}else
    {signals.Dir1=2;}
    //M15
    if(iClose(TradePairs, PERIOD_M15,1)<iOpen(TradePairs, PERIOD_M15,0)){signals.Dir2=0;}else
    if(iClose(TradePairs, PERIOD_M15,1)>iOpen(TradePairs, PERIOD_M15,0)){signals.Dir2=1;}else
    {signals[i].Dir2=2;}
    //M30
    if(iClose(TradePairs[i], PERIOD_M30,1)<iOpen(TradePairs[i], PERIOD_M30,0)){signals[i].Dir3=0;}else
    if(iClose(TradePairs[i], PERIOD_M30,1)>iOpen(TradePairs[i], PERIOD_M30,0)){signals[i].Dir3=1;}else
    {signals[i].Dir3=2;}
    //H1
    if(iClose(TradePairs[i], PERIOD_H1,1)<iOpen(TradePairs[i], PERIOD_H1,0)){signals[i].Dir4=0;}else
    if(iClose(TradePairs[i], PERIOD_H1,1)>iOpen(TradePairs[i], PERIOD_H1,0)){signals[i].Dir4=1;}else
    {signals[i].Dir4=2;}
    //H4
    if(iClose(TradePairs[i], PERIOD_H4,1)<iOpen(TradePairs[i], PERIOD_H4,0)){signals[i].Dir5=0;}else
    if(iClose(TradePairs[i], PERIOD_H4,1)>iOpen(TradePairs[i], PERIOD_H4,0)){signals[i].Dir5=1;}else
    {signals[i].Dir5=2;}
    //D1
    if(iClose(TradePairs[i], PERIOD_D1,1)<iOpen(TradePairs[i], PERIOD_D1,0)){signals[i].Dir6=0;}else
    if(iClose(TradePairs[i], PERIOD_D1,1)>iOpen(TradePairs[i], PERIOD_D1,0)){signals[i].Dir6=1;}else
    {signals[i].Dir6=2;}
    //W1
    if(iClose(TradePairs[i], PERIOD_W1,1)<iOpen(TradePairs[i], PERIOD_W1,0)){signals[i].Dir7=0;}else
    if(iClose(TradePairs[i], PERIOD_W1,1)>iOpen(TradePairs[i], PERIOD_W1,0)){signals[i].Dir7=1;}else
    {signals[i].Dir7=2;}
    //MN1
    if(iClose(TradePairs[i], PERIOD_MN1,1)<iOpen(TradePairs[i], PERIOD_MN1,0)){signals[i].Dir8=0;}else
    if(iClose(TradePairs[i], PERIOD_MN1,1)>iOpen(TradePairs[i], PERIOD_MN1,0)){signals[i].Dir8=1;}else
    {signals[i].Dir8=2;}
    }
    for (int i=0;i<ArraySize(TradePairs);i++){
    for(int j=0;j<9;j++){
    if(
    signals[i].Dir0==0
    && signals[i].Dir1==0
    && signals[i].Dir2==0
    && signals[i].Dir3==0
    && signals[i].Dir4==0
    && signals[i].Dir5==0
    && signals[i].Dir6==0
    && signals[i].Dir7==0
    && signals[i].Dir8==0
    ){
    ColorPanel("C"+(string)i+"D"+(string)0,clrTurquoise,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)1,clrTurquoise,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)2,clrTurquoise,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)3,clrTurquoise,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)4,clrTurquoise,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)5,clrTurquoise,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)6,clrTurquoise,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)7,clrTurquoise,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)8,clrTurquoise,C'61,61,61');
    }else if(
    signals[i].Dir0==1
    && signals[i].Dir1==1
    && signals[i].Dir2==1
    && signals[i].Dir3==1
    && signals[i].Dir4==1
    && signals[i].Dir5==1
    && signals[i].Dir6==1
    && signals[i].Dir7==1
    && signals[i].Dir8==1
    ){
    ColorPanel("C"+(string)i+"D"+(string)0,clrViolet,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)1,clrViolet,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)2,clrViolet,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)3,clrViolet,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)4,clrViolet,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)5,clrViolet,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)6,clrViolet,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)7,clrViolet,C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)8,clrViolet,C'61,61,61');
    }else {
    ColorPanel("C"+(string)i+"D"+(string)0,SetClrDir(signals[i].Dir0),C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)1,SetClrDir(signals[i].Dir1),C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)2,SetClrDir(signals[i].Dir2),C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)3,SetClrDir(signals[i].Dir3),C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)4,SetClrDir(signals[i].Dir4),C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)5,SetClrDir(signals[i].Dir5),C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)6,SetClrDir(signals[i].Dir6),C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)7,SetClrDir(signals[i].Dir7),C'61,61,61');
    ColorPanel("C"+(string)i+"D"+(string)8,SetClrDir(signals[i].Dir8),C'61,61,61');
    }
    }
    }
    }
    color SetClrDir(int Value){
    if(Value==0){return (clrLime);}else
    if(Value==1){return (clrRed);}else
    {return (clrSilver);}
    }[/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]
     

    Attached Files:

  11. Adhiebae

    Adhiebae Member Credit Hunter

    Equity
    Credit
    Ref Point
    4/5,
    This is my review for this thread:
    Lanjutkan
     
  12. Adhiebae

    Adhiebae Member Credit Hunter

    Equity
    Credit
    Ref Point
    Gan bisa dijelaskan lebih spesifik nggak tujuan EA untuk apa? Untuk menentukan open posisi atau apa? Berdasarkan apa?
     
  13. Adhiebae

    Adhiebae Member Credit Hunter

    Equity
    Credit
    Ref Point
    Biar bisa sekalian belajar
     
  14. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    Tujuan EA Trade Manager, unlimitid tak terbatas, kedepannya bisa ditambah beraneka ragam konsep, mau dibikin trading otomatis boleh, mau dibikin tambahan martingle boleh, mau ditambahin moving average,rsi, dan konsep2 lainnya yang belum kepikiran juga boleh, pokoknya yang ada dipikiran ane ane codingin dan source code nya selamanya gratis, dan gak ada niatan lain lain selain pengen menuangkan hobi aja gan ^_^
     
    • Like Like x 2
  15. Adhiebae

    Adhiebae Member Credit Hunter

    Equity
    Credit
    Ref Point
    Mantaap ,.. Terus nyimak nih
     
  16. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    Siap... Oke Lanjut..
     
  17. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 011
    Next Mission aku Tambah STOCHASTIC, soalnya nie indie katanya populer, Let's Go
    Screenshot_11.jpg
     

    Attached Files:

  18. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 012
    ERROR ERROR.....
    Candle Direction tidak sesuai, hahaha.. revisi salah coding nih... kurang ngopi, Let's Go
    Screenshot_12.jpg
    //M1
    if(iClose(TradePairs, PERIOD_M1,1)<iClose(TradePairs, PERIOD_M1,0)){signals.Dir0=0;}else
    if(iClose(TradePairs, PERIOD_M1,1)>iClose(TradePairs, PERIOD_M1,0)){signals.Dir0=1;}else
    {signals.Dir0=2;}
    //M5
    if(iClose(TradePairs, PERIOD_M5,1)<iClose(TradePairs, PERIOD_M5,0)){signals.Dir1=0;}else
    if(iClose(TradePairs, PERIOD_M5,1)>iClose(TradePairs, PERIOD_M5,0)){signals.Dir1=1;}else
    {signals.Dir1=2;}
    //M15
    if(iClose(TradePairs, PERIOD_M15,1)<iClose(TradePairs, PERIOD_M15,0)){signals.Dir2=0;}else
    if(iClose(TradePairs, PERIOD_M15,1)>iClose(TradePairs, PERIOD_M15,0)){signals.Dir2=1;}else
    {signals[i].Dir2=2;}
    //M30
    if(iClose(TradePairs[i], PERIOD_M30,1)<iClose(TradePairs[i], PERIOD_M30,0)){signals[i].Dir3=0;}else
    if(iClose(TradePairs[i], PERIOD_M30,1)>iClose(TradePairs[i], PERIOD_M30,0)){signals[i].Dir3=1;}else
    {signals[i].Dir3=2;}
    //H1
    if(iClose(TradePairs[i], PERIOD_H1,1)<iClose(TradePairs[i], PERIOD_H1,0)){signals[i].Dir4=0;}else
    if(iClose(TradePairs[i], PERIOD_H1,1)>iClose(TradePairs[i], PERIOD_H1,0)){signals[i].Dir4=1;}else
    {signals[i].Dir4=2;}
    //H4
    if(iClose(TradePairs[i], PERIOD_H4,1)<iClose(TradePairs[i], PERIOD_H4,0)){signals[i].Dir5=0;}else
    if(iClose(TradePairs[i], PERIOD_H4,1)>iClose(TradePairs[i], PERIOD_H4,0)){signals[i].Dir5=1;}else
    {signals[i].Dir5=2;}
    //D1
    if(iClose(TradePairs[i], PERIOD_D1,1)<iClose(TradePairs[i], PERIOD_D1,0)){signals[i].Dir6=0;}else
    if(iClose(TradePairs[i], PERIOD_D1,1)>iClose(TradePairs[i], PERIOD_D1,0)){signals[i].Dir6=1;}else
    {signals[i].Dir6=2;}
    //W1
    if(iClose(TradePairs[i], PERIOD_W1,1)<iClose(TradePairs[i], PERIOD_W1,0)){signals[i].Dir7=0;}else
    if(iClose(TradePairs[i], PERIOD_W1,1)>iClose(TradePairs[i], PERIOD_W1,0)){signals[i].Dir7=1;}else
    {signals[i].Dir7=2;}
    //MN1
    if(iClose(TradePairs[i], PERIOD_MN1,1)<iClose(TradePairs[i], PERIOD_MN1,0)){signals[i].Dir8=0;}else
    if(iClose(TradePairs[i], PERIOD_MN1,1)>iClose(TradePairs[i], PERIOD_MN1,0)){signals[i].Dir8=1;}else
    {signals[i].Dir8=2;}[/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]
     

    Attached Files:

  19. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    Market Hari ini Selasa,05/09/2023 Jam WIB 10:16
    ^_^ SANGAT JELAS DUNIA FOREX SEDANG RAME PAGI INI...
    Screenshot_12a.jpg
     
  20. Riki Romansyah

    Riki Romansyah Member Credit Hunter

    Equity
    Credit
    Ref Point
    #my history coding is here 013
    Next Mission aku Tambah RSI, soalnya nie indie katanya populer juga, MARI KITA COBA,.... Let's Go
    RSI nya aku buat 3 biji aja buat perbandingan di tiap timeframe biar sama kaya stochastic...
    Screenshot_13.jpg
    void GetRSI(){
    string pair="";
    for(int i=0; i<ArraySize(TradePairs); i++)
    {
    pair=TradePairs;
    signals.RSI_A = iRSI(pair,trigger_RSIA_Timeframe,trigger_RSI_period,trigger_RSI_Applied,trigger_RSI_shift);
    signals.RSI_B = iRSI(pair,trigger_RSIB_Timeframe,trigger_RSI_period,trigger_RSI_Applied,trigger_RSI_shift);
    signals.RSI_C = iRSI(pair,trigger_RSIC_Timeframe,trigger_RSI_period,trigger_RSI_Applied,trigger_RSI_shift);

    EditText("TextRSI1A"+(string)i,(string)DoubleToString(signals.RSI_A,0) +"%",SetClrRSI(signals.RSI_A),8);
    EditText("TextRSI2A"+(string)i,(string)DoubleToString(signals.RSI_B,0) +"%",SetClrRSI(signals.RSI_B),8);
    EditText("TextRSI3A"+(string)i,(string)DoubleToString(signals.RSI_C,0) +"%",SetClrRSI(signals.RSI_C),8);
    }

    }
    color SetClrRSI(double Value){
    if(Value>80){return (clrTurquoise);}else
    if(Value<=80 && Value>=60){return (clrLime);}else
    if(Value<60 && Value>40){return (clrWhite);}else
    if(Value<=40 && Value>20){return (clrRed);}else
    if(Value<=20){return (clrViolet);}else
    {return (clrWhite);}
    }
     

    Attached Files:

    • Like Like x 1

Share This Page