BTC USD 60,726.0 Gold USD 4,328.60
Time now: Jun 1, 12:00 AM

pending order pakai script

Code:
//+------------------------------------------------------------------+
//|                                        Aiman - Martingale_PO.mq4 |
//|                                          Copyright © 2011, Aiman |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, Aiman."
#property link "Aiman"
#property show_inputs
#include <stdlib.mqh>

extern bool PO_buy      = false;
extern bool PO_sell     = false;
extern double startPrice = 0;  //-- Biarkan 0 untuk current price

extern double startLots     = 0.1;
extern double multiplier    = 2;
extern int totalLayer       = 5;
extern int Gap_Between_Pips = 40;

       int StopLoss = 0;
       int TakeProfit = 0;
       int Slippage = 5;

int start()
{
   double lot, sl, tp;
   int ticket, retry;
   
   double spread = MarketInfo(Symbol(),MODE_SPREAD)*Point;
   double ask = Ask-Gap_Between_Pips*Point;
   double bid = Bid+Gap_Between_Pips*Point; 

   if (startPrice != 0)
   {
      ask = startPrice;
      bid = startPrice;
   }

   for (int i=totalLayer; i>0; i--)
   {
      if (totalLayer != i)
      {
         [COLOR="DarkOrchid"]ask = ask-Gap_Between_Pips*Point; 
         bid = bid+Gap_Between_Pips*Point; [/COLOR]

         lot = NormalizeDouble(lot*multiplier,2);
      }
      else lot = startLots;

      if (PO_buy)
      {
         ticket = 0;
         retry = 0;
         while (ticket<1 && retry<10)
         {
            if (StopLoss>0)   sl=(ask-spread)-(StopLoss*Point); else sl=0;
            if (TakeProfit>0) tp=ask+(TakeProfit*Point); else tp=0;         
            ticket=OrderSend(Symbol(),OP_BUYLIMIT,lot,ask,Slippage,sl,tp,"",0,0,Lime);
            if (ticket<1) Print ("Order buy limit failed with error ", ErrorDescription(GetLastError()));
            Sleep (1000);
            retry++;
         }
      }
      if (PO_sell) 
      {
         ticket = 0;
         retry = 0;
         while (ticket<1 && retry<10)
         {
            if (StopLoss>0)   sl=(bid+spread)+(StopLoss*Point); else sl=0;
            if (TakeProfit>0) tp=bid-(TakeProfit*Point); else tp=0;         
            ticket=OrderSend(Symbol(),OP_SELLLIMIT,lot,bid,Slippage,sl,tp,"",0,0,Crimson); 
            if (ticket<1) Print ("Order sell limit failed with error ", ErrorDescription(GetLastError()));
            Sleep (1000);
            retry++;
         }
      }
   }   
   return(0);
}

Sila test dulu sebelum guna!

yg ni kan masta ???

thankssss...
 
Bro aiman nk mintak tlg mskkan function 'instantOrder'
kat script ni boleh? Dah try bt sendiri , asyik xjd je
:D

Dan lg 1 boleh x nilai TP tu diselaraskan utk smua layer?
kalo boleh ade function 'TakeProfitPrice'. Function 'TakeProfit' skrg kalo disetkan nilai berapa pips tp yg kte nk, TP tu x sm stp layer. dia ikut dr price stp layer tu, kalo boleh nk smua nilai price TP sm
:D:D

//+------------------------------------------------------------------+
//| Aiman - Martingale_PO.mq4 |
//| Copyright © 2011, Aiman |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, Aiman."
#property link "Aiman"
#property show_inputs
#include <stdlib.mqh>

extern bool PO_buy = false;
extern bool PO_sell = false;
extern double startPrice = 0; //-- Biarkan 0 untuk current price

extern double startLots = 0.1;
extern double multiplier = 2;
extern int totalLayer = 5;
extern int Gap_Between_Pips = 40;
extern int StopLoss = 0;
extern int TakeProfit = 0;

int Slippage = 50;

int start()
{
double lot, sl, tp;
int ticket, retry;

double spread = MarketInfo(Symbol(),MODE_SPREAD)*Point;
double ask = Ask-Gap_Between_Pips*Point;
double bid = Bid+Gap_Between_Pips*Point;


if (startPrice != 0)
{
ask = startPrice;
bid = startPrice;
}

for (int i=totalLayer; i>0; i--)
{
if (totalLayer != i)
{
ask = ask-Gap_Between_Pips*Point;
bid = bid+Gap_Between_Pips*Point;

lot = NormalizeDouble(lot*multiplier,2);
}
else lot = startLots;

if (PO_buy)
{
ticket = 0;
retry = 0;
while (ticket<1 && retry<10)
{
if (StopLoss>0) sl=(ask-spread)-(StopLoss*Point); else sl=0;
if (TakeProfit>0) tp=ask+(TakeProfit*Point); else tp=0;
ticket=OrderSend(Symbol(),OP_BUYLIMIT,lot,ask,Slippage,sl,tp,"",0,0,Lime);
if (ticket<1) Print ("Order buy limit failed with error ", ErrorDescription(GetLastError()));
Sleep (1000);
retry++;
}
}
if (PO_sell)
{
ticket = 0;
retry = 0;
while (ticket<1 && retry<10)
{
if (StopLoss>0) sl=(bid+spread)+(StopLoss*Point); else sl=0;
if (TakeProfit>0) tp=bid-(TakeProfit*Point); else tp=0;
ticket=OrderSend(Symbol(),OP_SELLLIMIT,lot,bid,Slippage,sl,tp,"",0,0,Crimson);
if (ticket<1) Print ("Order sell limit failed with error ", ErrorDescription(GetLastError()));
Sleep (1000);
retry++;
}
}
}
return(0);
}
 
Bro aiman nk mintak tlg mskkan function 'instantOrder'
kat script ni boleh? Dah try bt sendiri , asyik xjd je
:D

Dan lg 1 boleh x nilai TP tu diselaraskan utk smua layer?
kalo boleh ade function 'TakeProfitPrice'. Function 'TakeProfit' skrg kalo disetkan nilai berapa pips tp yg kte nk, TP tu x sm stp layer. dia ikut dr price stp layer tu, kalo boleh nk smua nilai price TP sm
:D:D

Instant Order

http://www.carigold.com/portal/forums/showpost.php?p=9543190&postcount=197

SL & TP

http://www.4shared.com/file/Q4FtYhd3/Modify_SL__TP_ALL.html
 
salam

masta2 semua ada tk script
buy dan sell stop serentak tapi pada price yg berbeza?
kita leh masukkan price buy dan sell tu.

dan script tu jgk leh set TP dan SL..

klu ada mintak jasa baik masta2 utk bagi link dia.
terima kasih:)
 
salam

masta2 semua ada tk script
buy dan sell stop serentak tapi pada price yg berbeza?
kita leh masukkan price buy dan sell tu.

dan script tu jgk leh set TP dan SL..

klu ada mintak jasa baik masta2 utk bagi link dia.
terima kasih:)

Try ni boss, tp script ni nilai TP && SL dia x selaras, kalo nk bg selaras kena gn script set TP n SL yg bro aiman bt, link ade kat post sblm post bro tu, post dr bro aiman :)

//+------------------------------------------------------------------+
//| Aiman - Martingale_PO.mq4 |
//| Copyright © 2011, Aiman |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, Aiman."
#property link "Aiman"
#property show_inputs
#include <stdlib.mqh>

extern bool PO_buy = false;
extern bool PO_sell = false;
extern double startPrice = 0; //-- Biarkan 0 untuk current price

extern double startLots = 0.1;
extern double multiplier = 2;
extern int totalLayer = 5;
extern int Gap_Between_Pips = 40;

int StopLoss = 0;
int TakeProfit = 0;
int Slippage = 50;

int start()
{
double lot, sl, tp;
int ticket, retry;

double spread = MarketInfo(Symbol(),MODE_SPREAD)*Point;
double ask = Ask+Gap_Between_Pips*Point;
double bid = Bid-Gap_Between_Pips*Point;

if (startPrice != 0)
{
ask = startPrice;
bid = startPrice;
}

for (int i=totalLayer; i>0; i--)
{
if (totalLayer != i)
{

{
ask = ask+Gap_Between_Pips*Point;
bid = bid-Gap_Between_Pips*Point;
}
lot = NormalizeDouble(lot*multiplier,2);
}
else lot = startLots;

if (PO_buy)
{
ticket = 0;
retry = 0;
while (ticket<1 && retry<10)
{
if (StopLoss>0) sl=(ask-spread)-(StopLoss*Point); else sl=0;
if (TakeProfit>0) tp=ask+(TakeProfit*Point); else tp=0;
ticket=OrderSend(Symbol(),OP_SELLSTOP,lot,ask,Slippage,sl,tp,"",0,0,Lime);
if (ticket<1) Print ("Order buy limit failed with error ", ErrorDescription(GetLastError()));
Sleep (1000);
retry++;
}
}
if (PO_sell)
{
ticket = 0;
retry = 0;
while (ticket<1 && retry<10)
{
if (StopLoss>0) sl=(bid+spread)+(StopLoss*Point); else sl=0;
if (TakeProfit>0) tp=bid-(TakeProfit*Point); else tp=0;
ticket=OrderSend(Symbol(),OP_SELLSTOP,lot,bid,Slippage,sl,tp,"",0,0,Crimson);
if (ticket<1) Print ("Order sell limit failed with error ", ErrorDescription(GetLastError()));
Sleep (1000);
retry++;
}
}
}
return(0);
}
 
sapa ada scrip bawah ni?

1) bila klik script untuk buy atau sell (untuk instant oder) akan tanya nak guna lot berapa? TP? SL? bilangan pos yang nak buka?

2) conditions sama kat atas cuma nak set untuk pending oder
 
sapa ada scrip bawah ni?

1) bila klik script untuk buy atau sell (untuk instant oder) akan tanya nak guna lot berapa? TP? SL? bilangan pos yang nak buka?

2) conditions sama kat atas cuma nak set untuk pending oder


sapa ada koleksi script ni :D
 
best kalau ada script.memudahkan kerja..hehehe
 
waduh. macam rusa masuk kampung buat pertama kali melayari cari gold ni..
 

Live Forex Chart

Currency
Rates
EUR / USD
1.15246
USD / JPY
160.305
GBP / USD
1.33430
USD / CHF
0.79622
USD / CAD
1.39325
EUR / JPY
184.744
AUD / USD
0.70520
Back
Top
Log in Register