logic BUY:
1.apabila candle pertama di TF 15 M ditutup di atas, dengan range minimal 30 point.
2.lalu buka candle berikutnya, naik 10 point langsung ambil posisi BUY.
logic SELL:
1.apabila candle pertama di TF 15 M ditutup di bawah, dengan range minimal 30 point.
2.lalu buka candle berikutnya, turun 10 point langsung ambil posisi SELL.
stop loss : 30 point
taking profit : 100 point
trailing stopnya : 20 point
NB: klo bisa, SL,TP,dan TS ( TrailingStop) nya di hidden.
dan jam tradingnya mulai jam 9.15 wita - 12.00 wita & dilanjutkan lagi trading jam 13.00 wita - 16.15 wita.
mohon bantuan revisi dan edit dari teman2 master yang mengerti MQL4.
//+------------------------------------------------------------------+
//| Belajar2.mq4 |
//| Copyright 2012, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
extern double Lots = 0.1;
extern bool use_hidden_TakeProfit = true;
extern int hidden_TakeProfit = 100;
extern bool use_hidden_StopLoss = true;
extern int hidden_Stoploss = 30 ;
extern int TrailingStop = 20 ;
extern int Magic = 12345;
extern int Slippage = 5;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if (iClose(Symbol (),0,1)>iOpen(Symbol(),0,1)&& iClose(Symbol(),0,1)-iOpen(Symbol(),0,1)<=20*Point)
{OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Ask-hidden_Stoploss*Point,Ask+hidden_TakeProfit*Point, "Belajar2",Magic,0,Blue);}
else if (iClose(Symbol (),0,1)<iOpen(Symbol(),0,1)&& iOpen(Symbol(),0,1)-iClose(Symbol(),0,1)<=20*Point)
{OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,Bid+ hidden_Stoploss*Point,Bid-hidden_TakeProfit*Point,"Belajar2",Magic,0,Red);}
if( OrderSelect(12345,SELECT_BY_TICKET) && OrderCloseTime()==0 ) {
if( OrderType()==OP_BUY ) {
OrderModify(OrderTicket(),OrderOpenPrice(),Open[0]-Point*TrailingStop,OrderTakeProfit(),0);
}
else if( OrderType()==OP_SELL ) {
OrderModify(OrderTicket(),OrderOpenPrice(),Open[0]+Point*TrailingStop,OrderTakeProfit(),0);
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
Programming - editing - modification EA, Script or Indicator for MT4 OR MT5 ---- Trading on the Forex market involves substantial risks, including complete possible loss of funds and other losses and is not suitable for all members. Client should make an independent judgments as to whether trading is appropriate for him/her in light of his/her financial condition, investment experience, risk tolerance and other factors.
Thursday, 10 January 2013
Friday, 28 December 2012
EA Builder Alternative
Expert advisor builders (generators)
Expert Advisor Builder for MetaTrader 4 is a well known web-based tool that is very basic and free. It's pretty old and it looks unsupported now, although there is a forum available.
EA Creator is a web-based expert advisors builder for MetaTrader 4. Unfortunately, it looks that it was abandoned.
EATree is a software for building expert advisors for MetaTrader 4 and MetaTrader 5. Here we connect boxes that represents AND logic, OR logic, IF condition, conversion or mathematical functions, time series, indicators (system or custom) and others to create the main logic. Finally, we connect that logic to the special Trade box.
ForexEAdvisor is also popular web-based expert advisor builder that is simple and free to use.
Forex Generator is a software for building expert advisors and technical indicators for MetaTrader 4 and MetaTrader 5. This application is the most similar to fxDreema. It uses visually connected blocks for creating a trading diagram. Each block represents some piece of code, a code function. In addition, there is a Block Editor to create and manage custom blocks. There is a forum available.
Molanis is a set of Java-based products for building expert advisors and technical indicators for MetaTrader 4 and MetaTrader 5. A trading diagram is created by connecting a few simple specially designed blocks. There is a forum available.
NoProgra is a new software for building expert advisors for MetaTrader 4. The way of algorithm creation here is as they say in "natural language". Which means, that we can build our project in a way we speak, write and think. This platform is Java-based and it's currently free to download and use.
StrategyTune is a free and simple web tool for building expert advisors for MetaTrader 4. No installations and no registrations needed, you can start building EA's just right now.
Visual Traders Studio is a software for building expert advisors for MetaTrader 4. Six basic Element types (blocks) are used to create the trading logic - Start element, Note element, Variable element, Logic element, Function element and End element. There is a forumavailable.
EAbuilder_FX Dreema
I have been looking for EAbuilder and in this website are some
http://fxdreema.com/alternatives
Question is does anyone has experience with any of the above ?
Basicaly I would look for anything that can provide good support and or good lessons on how to. I do want to build something complex.
http://fxdreema.com/alternatives
Question is does anyone has experience with any of the above ?
Basicaly I would look for anything that can provide good support and or good lessons on how to. I do want to build something complex.
Martingale code
I wrote a piece of code to do what you ask, I hope this helps.
There is not a expert adviser, is a code to add to yours experts.
=================================================
//+------------------------------------------------------------------+
//| test1.mq4 |
//| Copyright 2012, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
extern int MagicNumber=123;
extern double StartLotsize=0.01;
extern double MultiplierLot=2.0;
extern double StepOrder=10;
extern int MaxGrid=3;
//---------------------------------------------------------------------------------------
int MultiplierPoint;
double DigitsPoints;
int BuyCnt;
int SellCnt;
double PipsBuy;
double PipsSell;
bool SendBuy;
bool SendSell;
double LotBuy;
double LotSell;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
MultiplierPoint=1;
if(MarketInfo(Symbol(),MODE_DIGITS)==5||MarketInfo(Symbol(),MODE_DIGITS)==3) MultiplierPoint=10;
DigitsPoints=MarketInfo(Symbol(),MODE_POINT)*MultiplierPoint;
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
BuyCnt=0;
SellCnt=0;
PipsBuy=0;
PipsSell=0;
SendBuy=false;
SendSell=false;
LotBuy=StartLotsize;
LotSell=StartLotsize;
//----
for(int i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderMagicNumber()==MagicNumber)
{
if(OrderType()==OP_BUY)
{
BuyCnt++;
PipsBuy=(Bid-OrderOpenPrice())/DigitsPoints;
}
if(OrderType()==OP_SELL)
{
SellCnt++;
PipsSell=(OrderOpenPrice()-Ask)/DigitsPoints;
}
}
}
}
//----
if((BuyCnt<MaxGrid)&&(PipsBuy>=StepOrder))
{
LotBuy=NormLot(StartLotsize*MathMax(1,MathPow(MultiplierLot,BuyCnt)));
SendBuy=true;
}
if((SellCnt<MaxGrid)&&(PipsSell>=StepOrder))
{
LotSell=NormLot(StartLotsize*MathMax(1,MathPow(MultiplierLot,SellCnt)));
SendSell=true;
}
//----
if(SendBuy==true)
{
//send orders buy... with lot=LotBuy
return(0);
}
//----
if(SendSell==true)
{
//send orders sell... with lot=LotSell
return(0);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//Normalize lot //
double NormLot(double LotSize)
{
int LotDigit;
//------------------------------------------------------
//Broker lot info
double MinLot=MarketInfo(Symbol(),MODE_MINLOT);
double MaxLot=MarketInfo(Symbol(),MODE_MAXLOT);
double LotStep=MarketInfo(Symbol(),MODE_LOTSTEP);
//------------------------------------------------------
//Calculate lot digits
if(LotStep==1) LotDigit=0;
if(LotStep==0.1) LotDigit=1;
if(LotStep==0.01) LotDigit=2;
if(LotStep==0.001) LotDigit=3;
//------------------------------------------------------
return(NormalizeDouble(MathMin(MathMax(LotSize,MinLot),MaxLot),LotDigit));
}
There is not a expert adviser, is a code to add to yours experts.
=================================================
//+------------------------------------------------------------------+
//| test1.mq4 |
//| Copyright 2012, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
extern int MagicNumber=123;
extern double StartLotsize=0.01;
extern double MultiplierLot=2.0;
extern double StepOrder=10;
extern int MaxGrid=3;
//---------------------------------------------------------------------------------------
int MultiplierPoint;
double DigitsPoints;
int BuyCnt;
int SellCnt;
double PipsBuy;
double PipsSell;
bool SendBuy;
bool SendSell;
double LotBuy;
double LotSell;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
MultiplierPoint=1;
if(MarketInfo(Symbol(),MODE_DIGITS)==5||MarketInfo(Symbol(),MODE_DIGITS)==3) MultiplierPoint=10;
DigitsPoints=MarketInfo(Symbol(),MODE_POINT)*MultiplierPoint;
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
BuyCnt=0;
SellCnt=0;
PipsBuy=0;
PipsSell=0;
SendBuy=false;
SendSell=false;
LotBuy=StartLotsize;
LotSell=StartLotsize;
//----
for(int i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderMagicNumber()==MagicNumber)
{
if(OrderType()==OP_BUY)
{
BuyCnt++;
PipsBuy=(Bid-OrderOpenPrice())/DigitsPoints;
}
if(OrderType()==OP_SELL)
{
SellCnt++;
PipsSell=(OrderOpenPrice()-Ask)/DigitsPoints;
}
}
}
}
//----
if((BuyCnt<MaxGrid)&&(PipsBuy>=StepOrder))
{
LotBuy=NormLot(StartLotsize*MathMax(1,MathPow(MultiplierLot,BuyCnt)));
SendBuy=true;
}
if((SellCnt<MaxGrid)&&(PipsSell>=StepOrder))
{
LotSell=NormLot(StartLotsize*MathMax(1,MathPow(MultiplierLot,SellCnt)));
SendSell=true;
}
//----
if(SendBuy==true)
{
//send orders buy... with lot=LotBuy
return(0);
}
//----
if(SendSell==true)
{
//send orders sell... with lot=LotSell
return(0);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//Normalize lot //
double NormLot(double LotSize)
{
int LotDigit;
//------------------------------------------------------
//Broker lot info
double MinLot=MarketInfo(Symbol(),MODE_MINLOT);
double MaxLot=MarketInfo(Symbol(),MODE_MAXLOT);
double LotStep=MarketInfo(Symbol(),MODE_LOTSTEP);
//------------------------------------------------------
//Calculate lot digits
if(LotStep==1) LotDigit=0;
if(LotStep==0.1) LotDigit=1;
if(LotStep==0.01) LotDigit=2;
if(LotStep==0.001) LotDigit=3;
//------------------------------------------------------
return(NormalizeDouble(MathMin(MathMax(LotSize,MinLot),MaxLot),LotDigit));
}
Thursday, 27 December 2012
iCustom fxsniper3cci
supaya indinya bisa di set di EA juga di deklarasikan
"extern int CCI_Period = 14"
"extern int T3_Period = 5"
"extern double b = 0.618"
Nah untuk nilai indi ini bisa di lihat pada mt4 --->terkan CTRL D , maka akan kelihatan nilai nya output keluaran hanya satu macam aja
double x=iCustom(Symbol(),0,"fxsniper3cci",CCI_Period,T3_ Period,b,0,shif);
shif bisa di isi 0 (sekarang), 1( satu candel sebelum sekarang, 2(dua candel sebelum sekarang) dst.......
PHP Code:
double x=iCustom(Symbol(),0,"fxsniper3cci",CCI_Period,T3_Period,b,0,0);//(sekarang)
double xx=iCustom(Symbol(),0,"fxsniper3cci",CCI_Period,T3_Period,b,0,1);//satu candel sebelum sekarang
double xxx=iCustom(Symbol(),0,"fxsniper3cci",CCI_Period,T3_Period,b,0,2);//dua candel sebelum sekarang ==========================
kalau dilihat didata windows nya nilai outputnya hanya 1 nilainya bro
coba untuk cek value coba ini
PHP Code:
double x=iCustom(Symbol(),0,"fxsniper3cci",CCI_Period,T3_Period,b,0,0);
double y=iCustom(Symbol(),0,"fxsniper3cci",CCI_Period,T3_Period,b,1,0);
double z=iCustom(Symbol(),0,"fxsniper3cci",CCI_Period,T3_Period,b,2,0);
Comment("nilai x",x,
"\n nilai y",y,
"\n nilai z",z);iCustom CCI EMA
CCI EMA
the code in your post refers to it below.
for(i = limit; i >= 0; i--) {
cciTrendNow = iCustom(NULL, 0, "CCI EMA", CCIPeriod, MAPeriod, 1, i);
cciTrendPrevious = iCustom(NULL, 0, "CCI EMA", CCIPeriod, MAPeriod, 1, i+1);
================
All is says is: if CCI > 0 the trend is up: if < 0 the trend is down
the code in your post refers to it below.
for(i = limit; i >= 0; i--) {
cciTrendNow = iCustom(NULL, 0, "CCI EMA", CCIPeriod, MAPeriod, 1, i);
cciTrendPrevious = iCustom(NULL, 0, "CCI EMA", CCIPeriod, MAPeriod, 1, i+1);
================
All is says is: if CCI > 0 the trend is up: if < 0 the trend is down
for(i=limit; i>=0; i--)
{
int y = iBarShift(NULL,TimeFrame,Time[i]);
double cciTrend = iCCI(NULL, TimeFrame, 50, PRICE_TYPICAL, y);
TrendDoA[i] = EMPTY_VALUE;
TrendDoB[i] = EMPTY_VALUE;
Trend[i] = iCustom(NULL,TimeFrame,IndicatorFileName,0,y);
Direction[i] = Direction[i+1];
if (cciTrend>0) Direction[i] = 1;
if (cciTrend<0) Direction[i] = -1;
if (Direction[i]==-1) PlotPoint(i,TrendDoA,TrendDoB,Trend);
}
return(0);
}
Supertrend 3
The name of the indicator is Supertrend.
It only changes the color and know I think of adding a few pips when the indicator changes the signal, so I can search after the jump of the pips.
It only changes the color and know I think of adding a few pips when the indicator changes the signal, so I can search after the jump of the pips.
bool indBuy=false;
bool indSell=false;
double sigBuy = iCustom(NULL,0,"SuperTrend",10,3,0,0);
double sigSell = iCustom(NULL,0,"SuperTrend",10,3,1,0);
if (sigBuy != EMPTY_VALUE) indBuy=true;
if (sigSell != EMPTY_VALUE) indSell=true;
if (indBuy==true)
{
// place a buy order
}
if (indSell==true)
{
// place a sell order
}
Hope it helps.
======================
You're welcome.Lot's of thanks!! This was a really great help!! I haven't seen the fact with that EMPTY_VALUE
As you know the value in the current bar may change since the bar is till not closed and the price can move up or down. You may want to take the signal from the previous closed bar by changing the code to
double sigBuy = iCustom(NULL,0,"SuperTrend",10,3,0,1);
double sigSell = iCustom(NULL,0,"SuperTrend",10,3,1,1);
===============================
Subscribe to:
Posts (Atom)