Please fix this indicator or EA - page 4

 

HELP Bug in my code..

HI,

I have this simple indicator that draw a blue box over a time range showing the high and low of the that time range. The time range is a busy news period.

How ever it works sometimes and sometimes it doesnt. See picture on todays (2009-10-21) USDCAD. Worked, then it didnt??

Any ideas, obviously something to do with getting the high and low in a time frame specified.

 

need help

hello i have your ea "freedom131477". when i try i see 1problem. when market go far away the open position ruining account.so can you introduce in programming loss xxx usd in trade.

it's possibel? no pips but in money. so you know how much can you loss per trade when the market have a crazy turn.

thanks for your help

nuno

is pipmaker with10p3+

 

help With an Indicator

hi,

I am just trying to modify force index indicator to change color. change to green if previous value is less than the current, yellow if prev and current are the same and Red if current value is smaller than the previous value. i have modified the code but some part of the indicator is now missing (as shown in the attached image). below is the code:

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Yellow

#property indicator_color2 Green

#property indicator_color3 Red

//---- input parameters

extern int Force_Period=12;

extern int MA_Method=1;

//extern string "0=SMA, 1=EMA";

//---- buffers

double ExtMapBuffer1[],ExtMapBuffer2[],ExtMapBuffer3[];

double Force_Index[60000];

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexStyle(2,DRAW_LINE);

SetIndexBuffer(2,ExtMapBuffer3);

SetIndexEmptyValue(0,NULL);

SetIndexEmptyValue(1,NULL);

SetIndexEmptyValue(2,NULL);

ArraySetAsSeries(Force_Index,true);

//----

return(0);

}

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

//| Custom indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| Custom indicator iteration function |

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

int start()

{

int counted_bars=IndicatorCounted(),limit,i;

//----

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for(i=0; i<limit; i++)

{

Force_Index=(Close-Close)*Volume;

}

for (i=0;i<limit;i++)

{

if(iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i)<iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i+1))

{

ExtMapBuffer1=0;

ExtMapBuffer2=0;

ExtMapBuffer3=iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i);//Should draw a red Line

}

else if (iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i)>iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i+1))

{

ExtMapBuffer2=iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i);//Should Draw Green

ExtMapBuffer1=0;

ExtMapBuffer3=0;

}

else

if(iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i)==iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i+1))

{

ExtMapBuffer1=iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i);//Shoud draw Yellow.

ExtMapBuffer3=0;

ExtMapBuffer2=0;

}

}

//----

return(0);

}

Any help will be appreciated here.

Files:
 
soheilpro:
hi,

I am just trying to modify force index indicator to change color. change to green if previous value is less than the current, yellow if prev and current are the same and Red if current value is smaller than the previous value. i have modified the code but some part of the indicator is now missing (as shown in the attached image). below is the code:

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Yellow

#property indicator_color2 Green

#property indicator_color3 Red

//---- input parameters

extern int Force_Period=12;

extern int MA_Method=1;

//extern string "0=SMA, 1=EMA";

//---- buffers

double ExtMapBuffer1[],ExtMapBuffer2[],ExtMapBuffer3[];

double Force_Index[60000];

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexStyle(2,DRAW_LINE);

SetIndexBuffer(2,ExtMapBuffer3);

SetIndexEmptyValue(0,NULL);

SetIndexEmptyValue(1,NULL);

SetIndexEmptyValue(2,NULL);

ArraySetAsSeries(Force_Index,true);

//----

return(0);

}

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

//| Custom indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| Custom indicator iteration function |

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

int start()

{

int counted_bars=IndicatorCounted(),limit,i;

//----

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for(i=0; i<limit; i++)

{

Force_Index=(Close-Close)*Volume;

}

for (i=0;i<limit;i++)

{

if(iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i)<iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i+1))

{

ExtMapBuffer1=0;

ExtMapBuffer2=0;

ExtMapBuffer3=iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i);//Should draw a red Line

}

else if (iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i)>iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i+1))

{

ExtMapBuffer2=iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i);//Should Draw Green

ExtMapBuffer1=0;

ExtMapBuffer3=0;

}

else

if(iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i)==iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i+1))

{

ExtMapBuffer1=iMAOnArray(Force_Index,0,Force_Period,0,MA_Method,i);//Shoud draw Yellow.

ExtMapBuffer3=0;

ExtMapBuffer2=0;

}

}

//----

return(0);

}

Any help will be appreciated here.

Here is to you...

Files:
 

Thanks

Thank you so much Leledc.

The Force index that i have attached is a little bit different than what it is in the MT4 indicator list. can you take a look at my code and see if you can spot any error in coding the indicator?

thanks again for your time.

 

News script code with TS HELP!!!

Hi I'm new in this forum but, I saw that most of the people here know how to modify scripts. I wonder if somebody can help me to add a trailing stop in a news script. The unique requirement of this trailing stop is that this trailing stop should be activate at some distance like 10 pips with a trailing of 2 pips or 1.5 pips.

What I really want is to replace the TP by this TS but this trailing stop should have de minimum distance of activation of 8 pips or 10 pips.

The script for news that I have is this one:

//REQUERIMIENTOS= TOOLS,OPTIONS,EXPERTS (1,4,7)ACTIVADOS

#property copyright "none"

#property link "none"

//#property show_inputs

extern string _P_Trade = "FXPRO NEWS TRADE";

extern double Lots = 10; // ?????? ?????????? ????

extern int StopLoss = 50; // ?????? ?????????????? ?????

extern int TakeProfit = 10; // ?????? ?????????????? ?????

extern int DistanceSet = 20; // ?????????? ?? ?????

extern int Slippage = 3; // ??????????????? ????

//extern int TS = 30; //Trailing Stop

string Name_Expert = "Set2StopOrders";

bool UseSound = false; // ???????????? ???????? ??????

string NameFileSound = "expert.wav"; // ???????????? ????????? ?????

color clOpenBuy = LightBlue; // ???? ?????? BuyStop

color clOpenSell = LightCoral; // ???? ?????? SellStop

void start() {

double ldStop=0, ldTake=0;

double pAsk=Ask+DistanceSet*Point;

double pBid=Bid-DistanceSet*Point;

if (StopLoss!=0) ldStop=pAsk-StopLoss*Point;

if (TakeProfit!=0) ldTake=pAsk+TakeProfit*Point;

SetOrder(OP_BUYSTOP, pAsk, ldStop, ldTake);

if (StopLoss!=0) ldStop=pBid+StopLoss*Point;

if (TakeProfit!=0) ldTake=pBid-TakeProfit*Point;

SetOrder(OP_SELLSTOP, pBid, ldStop, ldTake);

}

void SetOrder(int op, double pp, double ldStop, double ldTake) {

color clOpen;

string lsComm=GetCommentForOrder();

if (op==OP_BUYSTOP) clOpen=clOpenBuy;

else clOpen=clOpenSell;

OrderSend(Symbol(),op,Lots,pp,Slippage,ldStop,ldTake,lsComm,0,0,clOpen);

if (UseSound) PlaySound(NameFileSound);

}

string GetCommentForOrder() {

return(Name_Expert+" "+GetNameTF(Period()));

}

string GetNameTF(int TimeFrame) {

switch (TimeFrame) {

case PERIOD_MN1: return("Monthly");

case PERIOD_W1: return("Weekly");

case PERIOD_D1: return("Daily");

case PERIOD_H4: return("H4");

case PERIOD_H1: return("H1");

case PERIOD_M30: return("M30");

case PERIOD_M15: return("M15");

case PERIOD_M5: return("M5");

case PERIOD_M1: return("M1");

default: return("UnknownPeriod");

}

}

 

Modification

HI,

I would like to make changes in my EA is anyone could help me

 

Need Help with code

I have been working on this indicator for hours and can't seem to get it right.

I want the indicator to fire off an alert and send me an email one time only, if price comes to within 15 pips of 34EMA/8EMA crossover. The condition should then reset once price moves a specified no. of pips (in this case 20 pips) away from 34EMA/8EMA Cross. I Tried tweaking the code and now I get 3 errors:

')' - wrong parameters count

'else' - unexpected token

'MAType' - internal error

Any Help will be greatly appreciated.

Thanks

Files:
 

Master Candle break out EA

.. could some one please take a look @ this indicator and see if it would be possible to make a EA out of it.

the indicator is a great indicator.

i would like an EA from it with the following added to it.. the ea would drawn support and resistance lines with alarm function with a user defined buffer for example.. let say +10/-10 from the upper or lower areas.

there would also be the option of user defined take profit, stop loss, option for adding trailing stop.

the alrm that is in the indicator needs to have a user defined limit.. right now it chimes while price is inside the master candle range.. very annoying.. if it were adjustable to like 3-5 audio chimes.. that would be better..

i just need to be notified when a master candle has been detected..

the the ea would draw trend lines then when trend line is broken.. i would hear another audio alarm.. and then when price hits the user defined price support or resistance lines the ea would execute a trade as defined by the user..

i would also like to be able to add the ea to several different pairs and time frames..

does this make sense?

please let me know i will also post a picture to help explain what i am looking for.

master candle indicator with explaination of EA conversion

Files:
 

aws indicators for mq4 help please

hi all, i have any indicators aws topgun soft, is possible converter for mq4?

Reason: