Devam Ediyor

486529 Armando_EA_2

The EA needs to wrok in all time frame

extern double TakeProfit=250.0;

extern int stop_loss = 100;

extern double TrailingStop=35.0;

extern double Lots=0.1;

extern int MA1_Period = 14;

extern int MA2_Period = 25;

extern int MA3_Period = 50;

extern int MA4_Period = 85;

extern int SPRED_MA1_BID=10;

extern int SPRED_MA2_BID=15;

extern int SPRED_MA3_BID=15;

extern int SPRED_MA4_BID=10;

//=====================================

if (curTrendState_1MA[1] == MA_UP)

IS=IS_ABUY /////////////Buy

if it hit stoploss

and if the condition mits

and if (curTrendState_1MA[1] == MA_UP)

IS=IS_ABUY /////////////Buy

it will open anathr trade

if it hit tralinstop

and if (curTrendState_1MA[1] == MA_UP)

IS=IS_ABUY /////////////Buy

and if the condition mits

it will open anathr trade

it will open one trade at a time

//=======================================

#property indicator_buffers 8

#property indicator_color1 Aqua

#property indicator_color2 Yellow

#property indicator_color3 Magenta

#property indicator_color4 DodgerBlue

#define MA_XX 0 //Default State

#define MA_UP 1 //Up Trend

#define MA_DN 2 //Down Trend

extern int MA1_Period = 14;

extern int MA2_Period = 25;

extern int MA3_Period = 50;

extern int MA4_Period = 85;

//-----------------------------------------------------------

// This will be the signal for Buy OR sell

//----------------------------------------------------------------

extern int stoploss=15;

extern int TrailingStop2=15;

extern int SPRED_MA1_BID=15;

extern int SPRED_MA2_BID=20;

extern int SPRED_MA3_BID=20;

extern int SPRED_MA4_BID=15;

double curMA1,curMA2,curMA3,curMA4;

//double curMA1[];

//double curMA2[];

//double curMA3[];

//double curMA4[];

double MA_Arr_1[];

double MA_Arr_2[];

double MA_Arr_3[];

double MA_Arr_4[];

//-----------------------------------------------------------

// This will be the signal for Buy OR sell

//----------------------------------------------------------------

double MA1_BID_PipCount[5];

double MA2_BID_PipCount[5];

double MA3_BID_PipCount[5];

double MA4_BID_PipCount[5];

int curTrendState_1MA[5];

double DecPoint;

double DecDigit;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_LINE,EMPTY,1);

SetIndexBuffer(0,MA_Arr_1);

SetIndexStyle(1,DRAW_LINE,EMPTY,2);

SetIndexBuffer(1,MA_Arr_2);

SetIndexStyle(2,DRAW_LINE,EMPTY,3);

SetIndexBuffer(2,MA_Arr_3);

SetIndexStyle(3,DRAW_LINE,EMPTY,4);

SetIndexBuffer(3,MA_Arr_4);

SetIndexLabel(0,"MA "+MA1_Period+"");

SetIndexLabel(1,"MA "+MA2_Period+"");

SetIndexLabel(2,"MA "+MA3_Period+"");

SetIndexLabel(3,"MA "+MA4_Period+"");

//----

if (Digits < 4) {

DecPoint = [url removed, login to view];

DecDigit = 2;

} else {

DecPoint = [url removed, login to view];

DecDigit = 4;

}}

int start()

{

int i,j,limit,counted_bars=IndicatorCounted();

if(counted_bars<0) return(-1);

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

if (limit > 100) limit = 100; //for speed up, count the latest 100 only

//Update Moving Average Drawing on the chart

for(i=limit; i>=0; i--)

{

curMA1 =iMA(NULL,0,MA1_Period,0,MODE_EMA,PRICE_CLOSE,i);

curMA2 =iMA(NULL,0,MA2_Period,0,MODE_EMA,PRICE_CLOSE,i);

curMA3 =iMA(NULL,0,MA3_Period,0,MODE_EMA,PRICE_CLOSE,i);

curMA4 =iMA(NULL,0,MA4_Period,0,MODE_EMA,PRICE_CLOSE,i);

MA_Arr_1[i]=curMA1;

MA_Arr_2[i]=curMA2;

MA_Arr_3[i]=curMA3;

MA_Arr_4[i]=curMA4;

if (curMA1 <Bid)curTrendState_1MA[1] = MA_UP;

if (curMA1 >Bid)curTrendState_1MA[1] = MA_DN;

//-----------------------------------------------------------

// This will be the signal for Buy OR sell

//----------------------------------------------------------------

MA1_BID_PipCount[1]= MathAbs(curMA1 -Bid)/DecPoint;

MA2_BID_PipCount[2]= MathAbs(curMA2 -Bid)/DecPoint;

MA3_BID_PipCount[3]= MathAbs(curMA3 -Bid)/DecPoint;

MA4_BID_PipCount[4]= MathAbs(curMA4 -Bid)/DecPoint;

}

Comment (

"MA1_BID_PipCount[1] "+" "+MA1_BID_PipCount[1]+"\n"+

"MA2_BID_PipCount[2] "+" "+MA2_BID_PipCount[2]+"\n"+

"MA3_BID_PipCount[3] "+" "+MA3_BID_PipCount[3]+"\n"+

"MA4_BID_PipCount[4] "+" "+MA4_BID_PipCount[4]+"\n"+

"");

//------------------------------------------------------------------------------------------------TRADE_XX = 0

if (MA1_BID_PipCount[1]<SPRED_MA1_BID) //IS_NO_TRADE;

if (MA2_BID_PipCount[2]<SPRED_MA2_BID) //IS_NO_TRADE;

if (MA3_BID_PipCount[3]<SPRED_MA3_BID) //IS_NO_TRADE;

if (MA4_BID_PipCount[4]<SPRED_MA4_BID) //IS_NO_TRADE;

//----------------------------------------------------------------------------------

//-----------------------------------------------------------

// This will be the signal for Buy

//---------------------------------------------------------------- /////////////Buy

if ((curTrendState_1MA[1] == MA_UP)&&

(MA1_BID_PipCount[1]>SPRED_MA1_BID)&&

(MA2_BID_PipCount[2]>SPRED_MA2_BID)&&

(MA3_BID_PipCount[3]>SPRED_MA3_BID)&&

(MA4_BID_PipCount[4]>SPRED_MA4_BID)) // IS=IS_ABUY;

//--------------------------------------------------------

//-----------------------------------------------------------

// This will be the signal for sell

//----------------------------------------------------------------////////////SELL

if ((curTrendState_1MA[1] == MA_DN)&&

(MA1_BID_PipCount[1]>SPRED_MA1_BID)&&

(MA2_BID_PipCount[2]>SPRED_MA2_BID)&&

(MA3_BID_PipCount[3]>SPRED_MA3_BID)&&

(MA4_BID_PipCount[4]>SPRED_MA4_BID)) // IS=IS_ASELL;

return(0);

}

Beceriler: Her şey Kabul, PHP

Daha fazlasını görün: up wrok, int i, buy comment, ima, aqua, signal indicator, extern, average function, function drawing, sell signal, indicator custom, moving average signal, buy sell indicator, indicator trend, open indicator, speed drawing, magenta update, drawing moving, chart indicator, buy sell signal, frame chart, limit speed, indicator buy sell, open trade time, chart indicator php

İşveren Hakkında:
( 0 değerlendirme ) MIAMI,

Proje NO: #2232439