Welcome to the MQL4 course - page 10

 

Hello again guys,

I placed an EA in the correct folder etc...but with a demo account from Alpari UK it has 5 decimal places and doesn't work...I tried it in another demo account (4 decimal places) and works fine...i checked the code and couldn't find anywhere that specifies 4 or 5 decimal places...not sure how to make it run with Alpari UK...I contacted them and they said contact the coder...not much help...

Anyway, any advice would be greatly appreciated guys...thanks again

 
amyfor:
Hello again guys,

I placed an EA in the correct folder etc...but with a demo account from Alpari UK it has 5 decimal places and doesn't work...I tried it in another demo account (4 decimal places) and works fine...i checked the code and couldn't find anywhere that specifies 4 or 5 decimal places...not sure how to make it run with Alpari UK...I contacted them and they said contact the coder...not much help...

Anyway, any advice would be greatly appreciated guys...thanks again

Some Ea could work with 5 digits by adding a 0 to the values.

eg: for 50 pips stop set a 500 value. If fails the code needs to adapted.

 
Linuxser:
Some Ea could work with 5 digits by adding a 0 to the values. eg: for 50 pips stop set a 500 value. If fails the code needs to adapted.

Thanks Linuxser....that worked...

 

Hello, CodersGuru! It is very kind to share your knowledge with everybody.

I'm pretty sure that people like you, who give without demanding anything in reward, always have new and great ideas! There are many good examples of this in the entire history.

RESPECT

 

respeks

 

Can somebody advise me what i'm doing wrong here

Hi Everyone,

Would someone be so kind as to tell me what i'm doing wrong here please? Its a sell script, but just doesn't seem to work. Basically, i'm using a pivot method. The only entry the user puts in is the price of the pivot. The script then takes 2% of the account ballance and divides it by the number of pips from the bid to the pivot, which in turn gives the lotsize. The script then creates a sell order based on this information.

All feedback would be welcome.

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

//| TunnelSell.mq4 |

//| Daniel Lim |

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

#property show_inputs

extern double TunnelWall;

int Percentage =2;

int Magic = 20081104;

double Lots;

double ContractSize;

#define LABEL "TunnelSell"

int start()

{

if (Point == 0.00001) ContractSize = 100000;

if (Point == 0.0001) ContractSize = 10000;

if (Point == 0.001) ContractSize = 1000;

if (Point == 0.01) ContractSize = 100;

double Pips = (TunnelWall-Bid);

double StopLoss=Pips*ContractSize;

Lots = ((AccountBalance()*Percentage)/StopLoss)*MarketInfo (Symbol(),MODE_POINT);

OrderSend(Symbol(), OP_SELL, Lots, Bid, 0, 0, 0, "Tunnel Sell", Magic, 0, Red);

Alert ("Short Position Opened on ", Symbol() ,"\n",

"Emergency Stop Loss = ",TunnelWall+Pips,"\n",

"Double Ante Target =", Bid - Pips,"\n",

"Primary Target =", Bid - (Pips*2),"\n",

"Secondary Target = ", Bid - (Pips*3),"\n",

"Tertiary Target = ", Bid - (Pips*4));

}
 

No need to bother now

No need to looks at this now... I've sorted it myself.

 
Limstylz:
Hi Everyone,

Would someone be so kind as to tell me what i'm doing wrong here please? Its a sell script, but just doesn't seem to work. Basically, i'm using a pivot method. The only entry the user puts in is the price of the pivot. The script then takes 2% of the account ballance and divides it by the number of pips from the bid to the pivot, which in turn gives the lotsize. The script then creates a sell order based on this information.

All feedback would be welcome.

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

//| TunnelSell.mq4 |

//| Daniel Lim |

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

#property show_inputs

extern double TunnelWall;

int Percentage =2;

int Magic = 20081104;

double Lots;

double ContractSize;

#define LABEL "TunnelSell"

int start()

{

if (Point == 0.00001) ContractSize = 100000;

if (Point == 0.0001) ContractSize = 10000;

if (Point == 0.001) ContractSize = 1000;

if (Point == 0.01) ContractSize = 100;

double Pips = (TunnelWall-Bid);

double StopLoss=Pips*ContractSize;

Lots = ((AccountBalance()*Percentage)/StopLoss)*MarketInfo (Symbol(),MODE_POINT);

OrderSend(Symbol(), OP_SELL, Lots, Bid, 0, 0, 0, "Tunnel Sell", Magic, 0, Red);

Alert ("Short Position Opened on ", Symbol() ,"\n",

"Emergency Stop Loss = ",TunnelWall+Pips,"\n",

"Double Ante Target =", Bid - Pips,"\n",

"Primary Target =", Bid - (Pips*2),"\n",

"Secondary Target = ", Bid - (Pips*3),"\n",

"Tertiary Target = ", Bid - (Pips*4));

}

i've seen this ea before but dunno where , better give full scripts..

 

Expert Advisor

I am trying to modify an indicator to place trades. Beside inserting the Order commands, what do I need to change to let MT4 know it is an EA? My program simply does not load/respond when I try to load it as an EA.

Also, where should I look to find this answer without bothering you experienced programmers?

 

Programmer course downloads?

I am going through the programming course done by codeguru, and it references this site as the location to download the samples in the tutorial, but I cannot find them anywhere. Can anyone help me?

Thanks!

Reason: