How to code? - page 113

 
mifiglo:
Pls can u suggest a way to bypass the repaint problem if the indicator repaints more than the current bar? thanks in advance

Suggestion: Write another code.

 
mifiglo:
Pls can u suggest a way to bypass the repaint problem if the indicator repaints more than the current bar? thanks in advance

You have to find how many bars repaints and then set the shift in the iCustom() function accordingly.

FerruFx

 
willmalou:
I have an ea that takes trades on a bar more than once. Is there any code that will allow only one trade per bar. EA attached.

Here's your solution:

if(timeprev!=Time[0]) {

timeprev = Time[0];

YOUR TRADING CONDITIONS HERE

}

Hope that helps.

FerruFx

 

help me debug this EA

guys this EA has failed to attach to my live account can someone help me.work on it and post it again when complete and may be improve it it works well with EUR/USD/GBP/USD.

Files:
fxbonz4i.ex4  9 kb
 

We need the mq4 file not the ex4 file. Otherwise we can't help you.

I suspect you downloaded a demo-only version of that EA.

 

Rsi Ea

Thanks Ferrux will try it tonight.

Would this be the correct way to place in code.

if (timeprev!=Time[0]){

timeprev = Time[0];

if (RSIDailyBuy1_1 > RSIDailyBuy1_2 && RSIH4Buy2_1 > RSIH4Buy2_2 && RSIHBuy3_1 > RSIHBuy3_2 && RSIH4Buy2_1 > RSI_Lower)

{

Order = SIGNAL_BUY;

}

if (RSIDailySell1_1 < RSIDailySell1_2 && RSIH4Sell2_1 < RSIH4Sell2_2 && RSIH1Sell3_1 < RSIH1Sell3_2 && RSIH4Buy2_1 < RSI_Upper)

{

Order = SIGNAL_SELL;

}

}

 

Thanks

Thanks again. it seems to have worked.

FerruFx:
Here's your solution:

Hope that helps.

FerruFx
 
willmalou:
Thanks again. it seems to have worked.

You're welcome.

FerruFx

 

Is this possible ?

Maybe someone can help me, i dont know if its possible or very hard to do it, but I would be very happy to have such tool. I need a simple EA or script with a help of MT4-LevelStop-Reverse indicator. I want my orders to be closed when i get opposite signal from indicator. If i have opened long order and get short signal the EA or script closes order and if i am short open order and get long sygnal the EA or script closes my short position. That's it

Thank you in advance

 

Add Trade Hours

How do I setup Time Trading hours in an EA?

I was trying this;

int TradeHour;

if(Hour()17) TradeHour = false;

but doesn't seem to be obeying the rule, it just trades whenever and I do have && TradeHour in my buy/sell statements.

Thanks

Reason: