//+------------------------------------------------------------------------+ //| MACD edited with new magic period.mq4 | //| periode yg dimodifikasi didapat dengan kecerdasan buatan tingkat dasar| //| period number is taken from book of soros, global crisis of capitalizm | //| any better performance please contact with pm | //+------------------------------------------------------------------------+ extern double Lots = 0.3; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { double MacdCurrent, MacdPrevious, MacdPrevious2, SignalCurrent; double SignalPrevious, MaCurrent, MaPrevious; int cnt, ticket, total, a, s, d, f; // initial data checks // cek data // it is important to make sure that the expert works with a normal // memastikan EA bekerja dengan normal // chart and the user did not make any mistakes setting external // tidak ada kesalahan user ataupun chart // variables (Lots, StopLoss, TakeProfit, // TrailingStop) in our case, we check TakeProfit // on a chart of less than 100 bars // memastikan grafik lebih dari 100 bar if(Bars<100) { Print("bars less than 100"); return(0); } // sederhanakan kode untuk percepat running-to simplify the coding and speed up access // data dipindahkan ke internal variabel-data are put into internal variables MacdCurrent=iMACD(NULL,0,6,18,1,PRICE_CLOSE,MODE_MAIN,0); MacdPrevious=iMACD(NULL,0,6,18,1,PRICE_CLOSE,MODE_MAIN,1); MacdPrevious2=iMACD(NULL,0,6,18,1,PRICE_CLOSE,MODE_MAIN,2); //------------------------------------------------------------------------------- // if we use artificial neural network // the best combination of period for each technical indicator // will created instantly without significant consecutive loss // i am still work on it // always hope some one to help our team in jakarta...... :-) // anything better the period that we have now are welcome //------------------------------------------------------------------------------- // periode didapat dari kutipan soros pada bukunya // global crisis of capitalizm // time periode are got from soros's book total=OrdersTotal(); if(total<1) { // no opened orders identified if(AccountFreeMargin()<(1000*Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } //-----------------------------------------------------------------penting // check for long position (BUY) possibility //-----------------------------------------------------------------penting //if(MacdCurrent>0 && MacdCurrent<0.2&& MacdPrevious>0&& MacdPrevious<0.2&& MacdPrevious2>MacdPrevious<MacdCurrent) if(MacdPrevious2>0 && MacdPrevious2<0.06 && MacdPrevious2>MacdPrevious<MacdCurrent) //OP_BUY,Lots,Ask,3,Ask - 200*Point,Ask + 200*Point,"macd sample",16384,0,Green); { ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+40*Point,"macd sample",16384,0,Green); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); } else Print("Error opening BUY order : ",GetLastError()); return(0); } //-----------------------------------------------------------------penting }}// the end-tamat
Sample
Analysis
Market Information Used:
Indicator Curves created:
Indicators Used:
MACD Histogram
Custom Indicators Used:
Order Management characteristics:
Checks for the total of open orders
It automatically opens orders when conditions are reached
Other Features: