BTC USD 83,805.0 Gold USD 4,186.73
Time now: Jun 1, 12:00 AM

indi Untuk Newbies

ADAKAH ANDA BERPUAS HATI


  • Total voters
    0
  • Poll closed .
Status
Not open for further replies.
itulah forex kadang kita terlampau gopah untuk memasuki trend.
kita dah tahu arah trend nak buy pergi tekan sell.
selalu terjadi juga pada sya.harap kita sama tenangkan fikiran sebelum
membuka post.mc tu adat le berforex.bangkit tt
 
ya tengah bangkit
sehari 10usd n stop
sebulan 300usd
jadi la lebih kurang gaji aku kerja kilang jer
 
//+------------------------------------------------------------------+
//| "PROJEK CUBA NAK JADI KAYA CEPAT" |
//| kopi rait hak ciplak terhuru-hara © 2010, ANAKANTU PISANG |
//+------------------------------------------------------------------+
//------------------
#property copyright "anakantu pisang"
#property link "musangpulutt"

//user input
extern double Lots = 0.75;
extern int Slippage = 3;
extern int TP = 60;
extern int SL = 27;
extern bool isIBFXmini=false;

// globals
string mySymbol;
string postfix;

// trade management
double ask, bid, point;

string TradeComment="Dah buy Dah";
int MagicNumber=12345678;


// used for verbose error logging
#include <stdlib.mqh>


//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+

int init()
{
if(isIBFXmini) postfix="m";

mySymbol="Symbol()"+postfix; OpenPos("Buy");
mySymbol="Symbol()"+postfix; OpenPos("Buy");

}

int start() {}

//ENTRY LONG (buy, Ask)
void OpenPos(string Trade)
{
int gle=0;
int ticket=0;

int loopcount;

loopcount=0;
while(true)
{
bid=MarketInfo(Symbol(),MODE_BID);
ask=MarketInfo(Symbol(),MODE_ASK);
point=MarketInfo(Symbol(),MODE_POINT);

double TPBuy=0;
double SLBuy=0;

if(TP>0){TPBuy=ask+TP*point;}
if(SL>0){SLBuy=ask-SL*point;}

if (Trade=="Buy") ticket=OrderSend(Symbol(),OP_BUY,Lots,ask,Slippage ,SLBuy,TPBuy,TradeComment,MagicNumber ,White);

gle=GetLastError();
if(gle==0)
{
if (Trade=="Buy") Print("BUY PLACED Ticket="+ticket+" Ask="+ask+" Lots="+Lots);
break;
}
else
{
if (Trade=="Buy") 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)
{
if (Trade=="Buy") Print("-----ERROR----- Giving up on placing BUY order");
return(gle);
}
}
}
}

amik ni compile..

buy siap ada SL ngan TP
 
Last edited:
//+------------------------------------------------------------------+
//| "PROJEK CUBA NAK JADI KAYA CEPAT" |
//| kopi rait hak ciplak terhuru-hara © 2010, ANAKANTU PISANG |
//+------------------------------------------------------------------+
//------------------
#property copyright "anakantu pisang"
#property link "musangpulutt"

//user input
extern double Lots = 0.75;
extern int Slippage = 3;
extern int TP = 60;
extern int SL = 27;
extern bool isIBFXmini =false;

// globals
string mySymbol;
string postfix;

// trade management
double ask, bid, point;

string TradeComment=" Dah Sell Dah ";
int MagicNumber=12345678;


// used for verbose error logging
#include <stdlib.mqh>


//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int init()

{

if(isIBFXmini) postfix="m";

mySymbol="Symbol()"+postfix; OpenPos("Sell");
mySymbol="Symbol()"+postfix; OpenPos("Sell");

}

int start() {}

//ENTRY LONG (buy, Ask)

void OpenPos(string Trade)

{

int gle=0;
int ticket=0;

int loopcount;

loopcount=0;
while(true)

{

bid=MarketInfo(Symbol(),MODE_BID);
ask=MarketInfo(Symbol(),MODE_ASK);
point=MarketInfo(Symbol(),MODE_POINT);

double TPSell=0;
double SLsell=0;

if(TP>0){TPSell=bid-TP*point;}
if(SL>0){SLsell=bid+SL*point;}

if (Trade=="Sell") ticket=OrderSend(Symbol(),OP_SELL,Lots,bid,Slippage,SLsell,TPSell,TradeComment,MagicNumber,Red);

gle=GetLastError();
if(gle==0)

{

if (Trade=="Sell") Print("SELL PLACED Ticket="+ticket+" Bid="+bid+" Lots="+Lots);
break;

}

else

{

if (Trade=="Sell") Print("-----ERROR----- placing SELL 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)

{

if (Trade=="Sell") Print("-----ERROR----- Giving up on placing SELL order");
return(gle);

}
}
}
}

sell siap SL TP

adjust lot, SL, TP pastu compile
 
Status
Not open for further replies.

Latest Posts

Live Forex Chart

Currency
Rates
EUR / USD
1.13502
USD / JPY
157.031
GBP / USD
1.32871
USD / CHF
0.83459
USD / CAD
1.41848
EUR / JPY
178.234
AUD / USD
0.69685
Back
Top
Log in Register