aiman
Active Member

- Messages
- 1,889
- Joined
- Apr 19, 2006
- Messages
- 1,889
- Reaction score
- 1,356
- Points
- 101
rasa nye dah betul code tu.. bro masukkan price target..
saya dah update script kat atas tu, tambah price
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.

rasa nye dah betul code tu.. bro masukkan price target..

macam belajo buat ea plak,
nak tanyer sikit,,
macamana yerkk kalu kita nak set TP begini:
TP = perbezaan post pertama dgn post terakhir dibahagi dengan bilangan open post
bagaimana arahan yg sesuai yerk..
Thanks..
boleh untung ke macam ni?:-?

Sory bro aiman..
tersalah kiraan,
sebetulnya :
TP = perbezaan post pertama dgn post terakhir dibahagi dengan 2
Terima kasih banyak atas teguran masta...![]()
//+------------------------------------------------------------------+
//| Middle Price.mq4 |
//| Copyright © 2010, Aiman |
//| Aiman |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, Aiman"
#property link "Aiman"
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start ()
{
double topBuy=0, botBuy, topSell=0, botSell, midBuy, midSell;
for (int i=0; i<OrdersTotal(); i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol()!=Symbol()) continue;
if (OrderType()==OP_BUY)
{
if (topBuy==0)
{
topBuy=OrderOpenPrice();
botBuy=OrderOpenPrice();
}
else
{
topBuy=MathMax(topBuy,OrderOpenPrice());
botBuy=MathMin(botBuy,OrderOpenPrice());
}
}
if (OrderType()==OP_SELL)
{
if (topSell==0)
{
topSell=OrderOpenPrice();
botSell=OrderOpenPrice();
}
else
{
topSell=MathMax(topSell,OrderOpenPrice());
botSell=MathMin(botSell,OrderOpenPrice());
}
}
}
if (topBuy!=0) midBuy = (topBuy+botBuy)/2;
if (topSell!=0) midSell= (topSell+botSell)/2;
Comment (" Middle Price for Buy: ",NormalizeDouble(midBuy,Digits),"\n",
" Middle Price for Sell: ",NormalizeDouble(midSell,Digits));
return (0);
}
//+------------------------------------------------------------------+
bro, swiss army EA boleh buat tu.. google je. tak pon multipurpose EA ada kat FF..
Bawah ni script.
Rasanya pakai be calculator kat sebelah lagi baik.Code://+------------------------------------------------------------------+ //| Middle Price.mq4 | //| Copyright © 2010, Aiman | //| Aiman | //+------------------------------------------------------------------+ #property copyright "Copyright © 2010, Aiman" #property link "Aiman" //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start () { double topBuy=0, botBuy, topSell=0, botSell, midBuy, midSell; for (int i=0; i<OrdersTotal(); i++) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol()!=Symbol()) continue; if (OrderType()==OP_BUY) { if (topBuy==0) { topBuy=OrderOpenPrice(); botBuy=OrderOpenPrice(); } else { topBuy=MathMax(topBuy,OrderOpenPrice()); botBuy=MathMin(botBuy,OrderOpenPrice()); } } if (OrderType()==OP_SELL) { if (topSell==0) { topSell=OrderOpenPrice(); botSell=OrderOpenPrice(); } else { topSell=MathMax(topSell,OrderOpenPrice()); botSell=MathMin(botSell,OrderOpenPrice()); } } } if (topBuy!=0) midBuy = (topBuy+botBuy)/2; if (topSell!=0) midSell= (topSell+botSell)/2; Comment (" Middle Price for Buy: ",NormalizeDouble(midBuy,Digits),"\n", " Middle Price for Sell: ",NormalizeDouble(midSell,Digits)); return (0); } //+------------------------------------------------------------------+

sesapa yang belom ada
Code://+------------------------------------------------------------------+ //| close-all-orders.mq4 | //| Copyright © 2009 Lukpayat | //| www.OasisWealthBuilders.com | //+------------------------------------------------------------------+ #property copyright "Copyright © Oasis." #property link "www.oasiswealthbuilders.com" #property show_confirm int start() { int total = OrdersTotal(); for(int i=total-1;i>=0;i--) { OrderSelect(i, SELECT_BY_POS); int type = OrderType(); bool result = false; switch(type) { case OP_BUYLIMIT : result = OrderDelete(OrderTicket()); break; case OP_SELLLIMIT : result = OrderDelete(OrderTicket()); break; case OP_BUYSTOP : result = OrderDelete(OrderTicket()); break; case OP_SELLSTOP : result = OrderDelete(OrderTicket()); break; //Close opened long positions case OP_BUY : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red ); break; //Close opened short positions case OP_SELL : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red ); break; } if(result == false) { Alert("Order " , OrderTicket() , " failed to close. Error:" , GetLastError() ); Sleep(3000); } } return(0); }