Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
cadangan yg baik dari tuan. tapi amber masih pening lalat. ambik masa la bagi nubi cam amber nak paham
if (iOpen(0,0,0)>s5 && Bid<=s5) lotMM = 0.9; //-- candle cross s5 ataupun
if (iOpen(0,0,0)>s4 && Bid<=s4) lotMM = 0.8;//-- candle cross s4 ataupun
if (iOpen(0,0,0)>s3 && Bid<=s3) lotMM = 0.7;//-- candle cross s3 ataupun
if (iOpen(0,0,0)>s2 && Bid<=s2) lotMM = 0.6;//-- candle cross s2 ataupun
if (iOpen(0,0,0)>s1 && Bid<=s1) lotMM = 0.5; //-- candle cross s1
//if(lotMM >= MaxLotSize) lotMM = MaxLotSize;
if (iOpen(0,0,0)<r5 && Ask>=r5) lotMM = 0.9;//-- candle cross r5 ataupun
if (iOpen(0,0,0)<r4 && Ask>=r4) lotMM = 0.8; //-- candle cross r4 ataupun
if (iOpen(0,0,0)<r3 && Ask>=r3) lotMM = 0.7; //-- candle cross r3 ataupun
if (iOpen(0,0,0)<r2 && Ask>=r2) lotMM = 0.6;//-- candle cross r2 ataupun
if (iOpen(0,0,0)<r1 && Ask>=r1) lotMM = 0.5;

Code:if (iOpen(0,0,0)>s5 && Bid<=s5) lotMM = 0.9; //-- candle cross s5 ataupun if (iOpen(0,0,0)>s4 && Bid<=s4) lotMM = 0.8;//-- candle cross s4 ataupun if (iOpen(0,0,0)>s3 && Bid<=s3) lotMM = 0.7;//-- candle cross s3 ataupun if (iOpen(0,0,0)>s2 && Bid<=s2) lotMM = 0.6;//-- candle cross s2 ataupun if (iOpen(0,0,0)>s1 && Bid<=s1) lotMM = 0.5; //-- candle cross s1 //if(lotMM >= MaxLotSize) lotMM = MaxLotSize; if (iOpen(0,0,0)<r5 && Ask>=r5) lotMM = 0.9;//-- candle cross r5 ataupun if (iOpen(0,0,0)<r4 && Ask>=r4) lotMM = 0.8; //-- candle cross r4 ataupun if (iOpen(0,0,0)<r3 && Ask>=r3) lotMM = 0.7; //-- candle cross r3 ataupun if (iOpen(0,0,0)<r2 && Ask>=r2) lotMM = 0.6;//-- candle cross r2 ataupun if (iOpen(0,0,0)<r1 && Ask>=r1) lotMM = 0.5;
sye tk pakai stoct pn dalam EA sye ni...D
sye pakai garisan fibo ni je.. semua profit...takde lose langsung..tapi apa yg sye nk majukan lagi ialah:
Bila..
Katakan harga semasa dh cross kt S1..pastu robot ni buat buy..tapi hrga turun lagi ke S2..pastu lagi robot buat buy...kemudian harga turun lagi.. robot pn buat buy kt S3..
semua ada 3 buy...
macam mana nk buat bila OP yg pada S3 tdi dh profit 50 pips.. semua OP S2,S3 ni nk close (exit)...
kirannya S3 ni bukak lot besar dan cover kerugian S1 dan S2..![]()
double KiraLots (int orderType)
{
double lots = 0;
for (int i=0; i<OrdersTotal(); i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol()!=Symbol() || OrderType()!=orderType || OrderMagicNumber()!=magicNumber) continue;
lots = MathMax (lots, OrderLots());
}
if (lots ==0) return (0.5);
return (NormalizeDouble(lots+0.1,2));
}
OrderSend(Symbol(),OP_BUY,[COLOR="Navy"]KiraLots(OP_BUY)[/COLOR],Ask,3,0,0,"komen saya",magicNumber,0,Green);
OrderSend(Symbol(),OP_SELL,[COLOR="navy"]KiraLots(OP_SELL)[/COLOR],Bid,3,0,0,"komen saya",magicNumber,0,Red);
double KiraPips (int orderType)
{
double pips=0;
for (int i=0; i<OrdersTotal(); i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol()!=Symbol() || OrderMagicNumber()!=magicNumber || OrderType()!=orderType) continue;
if (orderType==OP_BUY) pips = MathMax(Bid-OrderOpenPrice())/Point, pips);
if (orderType==OP_SELL) pips = MathMax(OrderOpenPrice()-Ask)/Point, pips);
}
return (NormalizeDouble(pips, 0));
}
if ([COLOR="navy"]KiraPips(OP_BUY)[/COLOR]>=50)
{
[COLOR="DimGray"]//-- letakkan close all buy function di sini[/COLOR]
}
if ([COLOR="navy"]KiraPips(OP_SELL)[/COLOR]>=50)
{
[COLOR="DimGray"]//-- letakkan close all sell function di sini[/COLOR]
}

close semua open pos bila strategy tester stop

salam .. sy newbi. nak minta bro tempe atau aiman leh tak tulung wat kan ea camni :
scan ada post tak { kalo takde masuk 10 post serentak }
post sell atau buy set di variable. tp 10 sl takde
gak2 camne kod dia?
tq
int start ()
{
[COLOR="Gray"]// kira total pos untuk current chart[/COLOR]
int totalPos = 0; [COLOR="gray"]// declare variable untuk total pos[/COLOR]
for (int i=0; i<OrdersTotal(); i++) [COLOR="gray"]// loop 1 per 1 [/COLOR]
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES); [COLOR="Gray"]// select pos ikut turutan ticket #[/COLOR]
if (OrderSymbol()!=Symbol) continue; [COLOR="Gray"]// sekiranya pair bukan current chart.... skip[/COLOR]
if (OrderType()!=OP_BUY || OrderType()!=OP_SELL) continue; [COLOR="gray"]// kalau bukan BUY atau SELL.... skip[/COLOR]
totalPos++; [COLOR="gray"]// totalPos tambah 1[/COLOR]
}
if (totalPos==0) [COLOR="gray"]// sekiranya totalpos = 0 [/COLOR]
{
for (int i=0; i<10; i++) [COLOR="Gray"]// repeat 10 kali[/COLOR]
{
OrderSend(Symbol(),OP_BUY,1,Ask,3,0,Ask+10*Point,"My order buy",0,0,Green); [COLOR="gray"]// buy 1 lot tp 10[/COLOR]
Sleep (1000); [COLOR="gray"]// delay 1 saat[/COLOR]
OrderSend(Symbol(),OP_SELL,1,Bid,3,0,Bid-10*Point,"My order sell",0,0,Red); [COLOR="gray"]// sell 1 lot tp 10[/COLOR]
Sleep (1000); [COLOR="gray"]// delay 1 saat[/COLOR]
}
}
return (0);
}
extern double [COLOR="Red"]lot [/COLOR]= 1.0;
extern int [COLOR="red"]takeProfit [/COLOR]= 10.0;
[COLOR="Red"]double tpBuy=0;
double tpSell=0;
if (takeprofit>0)
{
tpBuy = Ask+takeProfit*Point;
tpSell = Bid-takeProfit*Point;
}[/COLOR]
OrderSend(Symbol(),OP_BUY,[COLOR="Red"]lot[/COLOR],Ask,3,0,[COLOR="Red"]tpBuy[/COLOR],"My order buy",0,0,Green);
OrderSend(Symbol(),OP_SELL,[COLOR="Red"]lot[/COLOR],Bid,3,0,[COLOR="Red"]tpSell[/COLOR],"My order sell",0,0,Red);