Ask! - page 107

 

It come to error like this.I try to put

entern int StringToInteger;

but still the error appear.

what should i do?

sorry for keep asking you but I really donno what I`m doing actually.So I would really appreciate your help .

'StringToInteger' - function is not defined F:\Program Files\MetaTrader - FXOpen\experts\EMA_10.mq4 (87, 28)
 
bearfoot090:
It come to error like this.I try to put

entern int StringToInteger;

but still the error appear.

what should i do?

sorry for keep asking you but I really donno what I`m doing actually.So I would really appreciate your help .

'StringToInteger' - function is not defined F:\Program Files\MetaTrader - FXOpen\experts\EMA_10.mq4 (87, 28) [/PHP]

"entern int StringToInteger;" has no meaning. but it's again my mistake, so again sorry... the function is StrToInteger()

So the code to close the orders sould be something like this :[PHP]for(int i = OrdersTotal() - 1; i >= 0; i --)

{

OrderSelect(i,SELECT_BY_POS,MODE_TRADES);

if(OrderMagicNumber() != Magic) continue;

if(TimeCurrent() > StrToInteger(OrderComment())) OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 0, CLR_NONE);

}

 

thank you michel!

I can compile it with no errors now.

 

error codes 130 & 131

speaking of error codes - does anybody know what these error codes mean?

they come up all the time when the EA tries to open a trade but cant because of this error

many thnx 4 any help

 
 

Help with line statement PLEASE

if(Period()==PERIOD_M15 && Symbol()=GBPUSD) UPLevel=.35;

What is lacking in this statement. I am getting an error about the currency symbol GBPUSD. Please assist in fixing my error!

Thanks a bunch in advance!

Dave

<<<

 
Dave137:
if(Period()==PERIOD_M15 && Symbol()=GBPUSD) UPLevel=.35;[/PHP]

What is lacking in this statement. I am getting an error about the currency symbol GBPUSD. Please assist in fixing my error!

Thanks a bunch in advance!

Dave

<<<
[PHP] if(Period()==PERIOD_M15 && Symbol()=="GBPUSD") UPLevel=0.35;
 

Thank You So Much!!

Dave

 

Hi codersguru

could you add signal with pop-up and arrows to indicator below?

Files:
 

Triple Trailing Stop Problem - Please Help In Coding!

void TrailingPositions() {

double pBid, pAsk, pp;

pp = MarketInfo(OrderSymbol(), MODE_POINT);

if (OrderType()==OP_BUY) {

pBid = MarketInfo(OrderSymbol(), MODE_BID);

//BreakEven routine

if (BreakEven>0) {

if ((pBid-OrderOpenPrice())>BreakEven*pp) {

if ((OrderStopLoss()-OrderOpenPrice())<0) {

ModifyStopLoss(OrderOpenPrice()+0*pp);

}

}

}

if (TrailingStop>0) {

if ((pBid-OrderOpenPrice())>TrailingStop_Over135*pp){ //15 pips TS

ModifyStopLoss(pBid-TrailingStop_Over135*pp);

if (pBid-OrderOpenPrice()>TrailingStop_Over90*pp && pBid-OrderOpenPrice()<TrailingStop_Over135*pp){ //55 pips TS

ModifyStopLoss(pBid-TrailingStop_Over90*pp);

if ((OrderOpenPrice()-pAsk)>TrailingStop +TrailingStep+1*pp && (OrderOpenPrice()-pAsk) < TrailingStop_Over90*pp+TrailingStep-1*pp || OrderStopLoss()==0) {//75 pips TS

ModifyStopLoss(pAsk+TrailingStop*pp);

return;

}

}

}

}

}

Three levels of Trailing Stop:

1) 75 Pips TS up to first 90 Pips Profit.

2) 55 Pips TS after 90 but only up to 135 pips profit.

3) 15 Pips TS after 135 pips profit.

The problem I am having is the Trailing Stop moves both up and down as the price moves up and down . . It should just be moving up as the price profit increases and stop if the price starts dropping! How do I get it to stop moving down as the price drops - The Trailing Stop is acting like a Yo-Yo as the price moves up and down.

I am not sure how to stop this from happening?? Please, I need your expertise!

Humbly,

Dave

Reason: