Harimau_kumbang
CG Top Poster Club

- Messages
- 23,197
- Joined
- Aug 3, 2007
- Messages
- 23,197
- Reaction score
- 380
- Points
- 141
Kena edit script tu. Sbb ni broker 5 decimal
So kalau sl 20 kena letak 200.. Kena tambah satu lagi kosong kat blakang
Kalau ada 6 decimal nnt 100pip TP jadi 10000 kot. Hehehe..
Yup.. Betul tue.
Script tue maybe kene edit.
Aku ada gak pkai script utk BUY & SELL.. Masta Luk ada kasi. tapi script tue aku dah edit utk run kat Acc Mini Exness.
Nie contoh script yg aku dah edit. GU Buy 5 post serentak.. kalo nak letak 2, 3 pun bleh.. ejas kat yg aku kaler merah tue. Maybe Acc Mini Acc nie kene letak GBPUSDm, kalo letak GBPUSD jer x bleh jalan coz aku dah try..
p/s: Kalo nak tukar Pair/currency kegemaran korg.. edit kat situ jer. tapi nie utk BUY only.
Code:
//+------------------------------------------------------------------+
//| Unicorn kuda_99 GBP/USD BUY.mq4 |
//| Copyright © 2009, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
// allow script to accept inputs from user
#property show_inputs
//user input
extern double Lots = 0.01;
extern int Slippage = 2;
extern bool isIBFXmini=false;
// globals
string mySymbol;
string postfix;
// trade management
double ask;
double bid;
string TradeComment="GPUSD jer..";
int MagicNumber=12345678;
// used for verbose error logging
#include <stdlib.mqh>
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int init()
{
if(isIBFXmini) postfix="m";
[COLOR="Red"]mySymbol="GBPUSDm"+postfix; OpenBuy();
mySymbol="GBPUSDm"+postfix; OpenBuy();
mySymbol="GBPUSDm"+postfix; OpenBuy();
mySymbol="GBPUSDm"+postfix; OpenBuy();
mySymbol="GBPUSDm"+postfix; OpenBuy();
[/COLOR]
}
int deinit()
{
}
int start()
{
}
//ENTRY LONG (buy, Ask)
void OpenBuy()
{
int gle=0;
int ticket=0;
double SL=0;
double TP=0;
int loopcount;
loopcount=0;
while(true)
{
bid=MarketInfo(mySymbol,MODE_BID);
ask=MarketInfo(mySymbol,MODE_ASK);
// place order - NO TP OR SL
ticket=OrderSend(mySymbol,OP_BUY,Lots,ask,Slippage ,0,0,TradeComment,MagicNumber,White);
gle=GetLastError();
if(gle==0)
{
Print("BUY PLACED Ticket="+ticket+" Ask="+ask+" Lots="+Lots);
break;
}
else
{
Print("-----ERROR----- Placing BUY order: Lots="+Lots+" SL="+SL+" TP="+TP+" Bid="+bid+" Ask="+ask+" ticket="+ticket+" Err="+gle+" "+ErrorDescription(gle));
RefreshRates();
Sleep(500);
// give up after 10 tries (~5 seconds)
loopcount++;
if(loopcount>10)
{
Print("-----ERROR----- Giving up on placing BUY order");
return(gle);
}
}
}//while - place order
}//BUYme