PedangSetiawan
Super Active Member
- Messages
- 8,740
- Joined
- May 14, 2010
- Messages
- 8,740
- Reaction score
- 105
- Points
- 83
masta2 aku dah try xda PO pon yg kuar.
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.

masta aiman/lukpayat,
aku tgh cari skrip utk modify pending order price, TP dan SL..katakan aku bukak po 20..so..tiba2 terpaksa tukar price PO tu..jadi nk tukar satu2 amik masa..kalo ade or blh buat..sila sharekan..hehe..setakt ni puas cari kt internet tak jumpa2..
//+------------------------------------------------------------------+
//| Aiman-Shift PO.mq4 |
//| Copyright © 2011, Aiman |
//| Aiman |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, Aiman"
#property link "Aiman"
#property show_inputs
#include <stdlib.mqh>
// +ve: lebih jauh, -ve: lebih dekat
extern int shift_buy_limit = 0;
extern int shift_sell_limit = 0;
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
for (int i=0; i<OrdersTotal(); i++)
{
double price=0, sl=0, tp=0;
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
[COLOR="Red"]if (OrderSymbol()!=Symbol()) continue;
if (OrderType()!=OP_BUYLIMIT && OrderType()!=OP_SELLLIMIT) continue;[/COLOR]
if (OrderType()==OP_BUYLIMIT && shift_buy_limit!=0)
{
price = OrderOpenPrice()-shift_buy_limit*Point;
if (OrderStopLoss()!=0) sl=OrderStopLoss()-shift_buy_limit*Point;
if (OrderTakeProfit()!=0) tp=OrderTakeProfit()-shift_buy_limit*Point;
}
if (OrderType()==OP_SELLLIMIT && shift_sell_limit!=0)
{
price = OrderOpenPrice()+shift_sell_limit*Point;
if (OrderStopLoss()!=0) sl=OrderStopLoss()+shift_sell_limit*Point;
if (OrderTakeProfit()!=0) tp=OrderTakeProfit()+shift_sell_limit*Point;
}
bool retry=true;
int cnt=0,err;
while(retry)
{
OrderModify(OrderTicket(),price,sl,tp,0,CLR_NONE);
err=GetLastError();
if (err>0) Print (ErrorDescription(err));
cnt++;
if (cnt>10 || err==0) retry = false;
Sleep(300);
}
}
//----
return(0);
}
//+------------------------------------------------------------------+

price = OrderOpenPrice()-shift_buy_limit*Point;





