How to code? - page 82

 

'void' - parameter definition expected!

string OpenTrades(string mySymbol,double LotSize, double OpenPrice,int Type, double StopLoss, double TakeProfit, string ticketComment, void string MagicNum)

{

// bu funksiye birilgen melumatqa asasen mal alidu we zakaz numurini qayturidu.

switch(Type)

{

case OP_BUY: if(OpenPrice > MarketInfo(mySymbol,MODE_ASK) return(EMPTY);

case OP_BUYLIMIT:

case OP_BUYSTOP:

OrderSend(mySymbol,Type,LotSize,OpenPrice,0,OpenPrice-Point*StopLoss,OpenPrice+Point*TakeProfit,ticketComment,MagicNum);

break;

case OP_SELL: if(OpenPrice < MarketInfo(mySymbol,MODE_BID) return(EMPTY);

case OP_SELLLIMIT:

case OP_SELLSTOP:

OrderSend(mySymbol,Type,LotSize,OpenPrice,0,OpenPrice+Point*StopLoss,OpenPrice-Point*TakeProfit,ticketComment,MagicNum);

break;

}

compiler error on : 'void' - parameter definition expected! ?????????

 
alimjan:
string OpenTrades(string mySymbol,double LotSize, double OpenPrice,int Type, double StopLoss, double TakeProfit,

string ticketComment, voidstring MagicNum)

...
compiler error on : 'void' - parameter definition expected! ?????????

just delete "void".

 

Trailing stop, initial stop

void ModifyOrder(double buyTS, sellTS) {

if (Bid - OrderOpenPrice() > buyTS * Point)

if (OrderStopLoss() < Bid - buyTS * Point) OrderModify(OrderTicket(), OrderOpenPrice(), Bid - buyTS * Point, OrderTakeProfit(), 0);

if (OrderOpenPrice() - Ask > sellTS * Point)

if (OrderStopLoss() > Ask + sellTS * Point) OrderModify(OrderTicket(), OrderOpenPrice(), Ask + sellTS * Point, OrderTakeProfit(), 0);

}

If the Trailing Stop is 40, the initial stop will be zero (orderopenprice)

I would like the initial stop to be 10 -

help please?

 

Cross Overs

DOES ANYONE KNOW HOW DO YOU WRITE WHEN TWO LINES CROSS OVER EACH OTHER

LETS SAY SAY IF 10 EMA IS ABOVE 20 EMA CONDTION 1

IF THAT CONDITION 1 IS THERE ....THEN TAKE A LONG WHEN STOCASTICS

D CROSSES ABOVE k

FOR D ABOVE K WE CAN USE D > K

WHAT DO YOU USE FOR D CROSS ABOVE k WHILE THE EMA CONDITION 1 IS IN PLACE?

 

Fix warning in EA

Hello, how do you fix this error in an EA?

'CloseHour' - expression on global scope not allowed

Thanks

 

Passing arrays between functions

Hi,

I am trying to pass arrays between function calls in my EA.

Here is the structure for my program.

I have the following files.

Helper.mq4

void writeLog(string[] orderLog)

{

orderLog[0] = "Text1";

orderLog[1] = "Text2";

orderLog[2] = "Text3";

}

[/CODE]

Helper.mqh

void writeLog(string[] orderLog);

EA.mq4

[CODE]

#include

string OrderLog[24] = {"","","","","","","","","","","","","","","","","","","","","","","",""};

int init()

{

writeLog(OrderLog);

return(0);

}

When I run the above snippet of code, I get the following errors:

',' - left square parenthesis expected for array

',' - parameter expected

',' - incompatible types

However, if I do not use libraries and place these functions into the EA.mq4 file itself, the code works.

Does anyone know how to pass functions between functions in another library?

Your help would be much appreciated.

 
syrndr:
Hi,

I am trying to pass arrays between function calls in my EA.

........

void writeLog(string & orderLog [] )

{

orderLog[0] = "Text1";

orderLog[1] = "Text2";

orderLog[2] = "Text3";

}

 

sum of two indicators

Can an experienced coder tell me how to draw the numerical sum of two indicators ?

I mean modifying the codes of an indicators to add the value of another indicator to draw combination of two indicator values

Thanks

 

buy and sell on the 100's

Can some one please write and EA to buy/sell on the round number eg gbp/jpy 201.00 203.00 etc. with target 100 pips no increase in lots size and no martangle. Thank you all very much. I have manualy doing it and gain profit every week. every month.

 

Zamanib,

What are all the details you look at to decide whether to buy or sell?

Big Be

Reason: