sama sama ya om. Good luck juga buat tradingnyabaik,maap ya bang
Forexnator,Littleguy, I'll test your EA. It makes a good impression. But you should have a broker that offers BTC/USD without commission. This can quickly lead to losses. The RAW account from Tickmill is without this commission.
ijin sedot,backtest dan edit, ganSilahkan bagi yg bisa mengoptimalkan EA nya.
This is my experiment EA on BTCUSD. Im looking for someone who can join me to develop this EA. Im not going to sell this EA if the EA work.
Im very interested on your opinion about this EA. Is this to good to be true or this maybe can happen actually.View attachment 167381 View attachment 167382
int ticket = OrderSend(Symbol(), OP_BUY, lotSize, Ask, 3, stopLoss, takeProfit, "Buy Order", 0, 0, clrGreen);
int ticket = OrderSend(Symbol(), OP_BUY, lotSize, Ask, 3, stopLoss, takeProfit, "Buy Order", mgn, 0, clrGreen);
int ticket = OrderSend(Symbol(), OP_BUY, lotSize, Ask, 3, stopLoss, takeProfit, "Buy Order", 0, 0, clrGreen);
int ticket = OrderSend(Symbol(), OP_SELL, lotSize, Bid, 3, stopLoss, takeProfit, "Sell Order", mgn, 0, clrRed);
//+------------------------------------------------------------------+
//| Inputs & Variables |
//+------------------------------------------------------------------+
input int mgn = 17081945; //Magic Number
if (lotSize < 0.01) lotSize = 0.01;
if (lotSize > 10) lotSize = 10;
if (lotSize < MinLot) lotSize = MinLot;
if (lotSize > MaxLot) lotSize = MaxLot;
input double MinLot = 0.01; //Minimum Lots
input double MaxLot = 1; //Maximum Lots
double RiskPercent = 5.0; // Risiko per trade dalam persen
double LotMultiplier = 10.0; // Pengali lot
double kaliTP = 2; // RiskReward
double TrailingStopPoints = 1000;
datetime lastBar = 0;
//+------------------------------------------------------------------+
//| Inputs & Variables |
//+------------------------------------------------------------------+
input int mgn = 17081945; //Magic Number
input double RiskPercent = 5.0; // Risiko per trade dalam persen
input double LotMultiplier = 1.1; // Pengali lot
input double TakeProfit = 1; // RiskReward
input double TrailingStopPoints = 25;
input double MinLot = 0.01; //Minimum Lots
input double MaxLot = 1; //Maximum Lots
input ENUM_TIMEFRAMES MinPeriod = PERIOD_H4; //Minimum Period
datetime lastBar = 0;
double lotSize = CalculateLot(RiskPercent, AccountBalance(), slDistance, LotMultiplier);
double lotSize = CalculateLot(RiskPercent, AccountFreeMargin(), slDistance, LotMultiplier);
// Logika entry buy
if (!signalUsedBuy &&
Close[1] > iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, 1) && // Harga di atas EMA 200
Close[1] > iSAR(NULL, 0, 0.02, 0.2, 1) && // Harga close di atas SAR[1]
Close[1] > lastSARCrossDown &&
Open[1] < Close[1]) // Candle bullish
{
OpenBuyOrder(iSAR(NULL, 0, 0.02, 0.2, 1)); // Buka order buy
signalUsedBuy = true; // Tandai sinyal telah digunakan
}
// Logika entry sell
if (!signalUsedSell &&
Close[1] < iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, 1) && // Harga di bawah EMA 200
Close[1] < iSAR(NULL, 0, 0.02, 0.2, 1) && // Harga close di bawah SAR[1]
Close[1] < lastSARCrossUp &&
Open[1] > Close[1]) // Candle bearish
{
OpenSellOrder(iSAR(NULL, 0, 0.02, 0.2, 1)); // Buka order sell
signalUsedSell = true; // Tandai sinyal telah digunakan
}
// Logika entry buy
if (!signalUsedBuy &&
Close[1] > iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, 1) && // Harga di atas EMA 200
Close[1] > iSAR(NULL, 0, 0.02, 0.2, 1) && // Harga close di atas SAR[1]
Close[1] > lastSARCrossDown &&
Close[1] < Bid) // Candle bullish
{
OpenBuyOrder(iSAR(NULL, 0, 0.02, 0.2, 1)); // Buka order buy
signalUsedBuy = true; // Tandai sinyal telah digunakan
}
// Logika entry sell
if (!signalUsedSell &&
Close[1] < iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, 1) && // Harga di bawah EMA 200
Close[1] < iSAR(NULL, 0, 0.02, 0.2, 1) && // Harga close di bawah SAR[1]
Close[1] < lastSARCrossUp &&
Close[1] > Ask) // Candle bearish
{
OpenSellOrder(iSAR(NULL, 0, 0.02, 0.2, 1)); // Buka order sell
signalUsedSell = true; // Tandai sinyal telah digunakan
}
//+------------------------------------------------------------------+
//| Expert initialization |
//+------------------------------------------------------------------+
int OnInit() {
Print("EA Initialized Successfully");
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert initialization |
//+------------------------------------------------------------------+
int OnInit() {
if(_Period < MinPeriod) return(INIT_FAILED); //Memastikan EA running di TF pilihan
Print("EA Initialized Successfully");
return(INIT_SUCCEEDED);
}
Mantap memang abang satu iniPerubahan di atas membuat EA mempunyai parameter input sebagai berikut:
View attachment 167397
Dengan grafik hasil backtest (1 bulan lalu sampai hari ini pada broker Octa) sebagai berikut:
View attachment 167398
Report:
View attachment 167399
Happy coding, have a nice day![]()
Terimakasih petunjuknya pak guruUntuk logika entry Buy dan entry Sell saya buat perubahan kecil untuk membuat Candle Bullish dan Candle Bearish menjadi lebih dikenali oleh EA:
Semula:
Code:// Logika entry buy if (!signalUsedBuy && Close[1] > iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, 1) && // Harga di atas EMA 200 Close[1] > iSAR(NULL, 0, 0.02, 0.2, 1) && // Harga close di atas SAR[1] Close[1] > lastSARCrossDown && Open[1] < Close[1]) // Candle bullish { OpenBuyOrder(iSAR(NULL, 0, 0.02, 0.2, 1)); // Buka order buy signalUsedBuy = true; // Tandai sinyal telah digunakan } // Logika entry sell if (!signalUsedSell && Close[1] < iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, 1) && // Harga di bawah EMA 200 Close[1] < iSAR(NULL, 0, 0.02, 0.2, 1) && // Harga close di bawah SAR[1] Close[1] < lastSARCrossUp && Open[1] > Close[1]) // Candle bearish { OpenSellOrder(iSAR(NULL, 0, 0.02, 0.2, 1)); // Buka order sell signalUsedSell = true; // Tandai sinyal telah digunakan }
Menjadi:
Code:// Logika entry buy if (!signalUsedBuy && Close[1] > iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, 1) && // Harga di atas EMA 200 Close[1] > iSAR(NULL, 0, 0.02, 0.2, 1) && // Harga close di atas SAR[1] Close[1] > lastSARCrossDown && Close[1] < Bid) // Candle bullish { OpenBuyOrder(iSAR(NULL, 0, 0.02, 0.2, 1)); // Buka order buy signalUsedBuy = true; // Tandai sinyal telah digunakan } // Logika entry sell if (!signalUsedSell && Close[1] < iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, 1) && // Harga di bawah EMA 200 Close[1] < iSAR(NULL, 0, 0.02, 0.2, 1) && // Harga close di bawah SAR[1] Close[1] < lastSARCrossUp && Close[1] > Ask) // Candle bearish { OpenSellOrder(iSAR(NULL, 0, 0.02, 0.2, 1)); // Buka order sell signalUsedSell = true; // Tandai sinyal telah digunakan }