How to code? - page 76

 
danielp:
Hi Guys,

How do you change an alert indicator into a trading EA?

I've tried changing the command Alert(Symbol()+" "+Period()+" XO Long ",Bid); into OrderSend(Symbol(),OP_BUY,0.01,Ask,3,20,20,"XO-CCI",1,0,Blue); at the start I chose menu to make EA, then content of my alert indicator, i copied to this EA, then I changed the command alert to trading command as above, then i compiled. But the compiled EA is not making any trade after i tried it on 1M chart for a day.

Please help.

Hi danielp!! Are you from fxreviews blog? I can help you for coding.

 

EA doesn't work

Can someone fix this EA?

The EA should work:

Buy - MA crosses from below the High of the bar (bar shift at 11 o'clock chart time).

Sell - MA crosses from above the Low of the bar (bar shift at 11 o'clock chart time).

Files:
 

adria

You didn't state the problem.

Big Be

 

When I backtest, it doesn't open the trades according to the set time (11 o'clock).

I think that iBarShift function is not entered correctly.

The EA should open the buy order after 11 o'clock when MA is higher then the

High of the bar which is placed at 11 o'clock.

The EA should open the sell order after 11 o'clock when MA is lower then the

Low of the bar which is placed at 11 o'clock.

 

Could you find the mistake?

Hi, could you take a look to the attached EA?

I seem it doesn't work as I want.

BUY opening: when the closing price cross the 65 EMA and the 20 EMA is over the 65 EMA. (The opposite for SELL opening).

Where is my mistake?

Thank you!

Files:
ema_3_20.mq4  4 kb
 

Need help debugging indicator

I rather like the indicator at tradethemarkets.com titled the TTM-Bricks. That is to say, I rather like the TTM implementation of the 3-line break (3LB). There are some MT4 versions of the 3LB floating around, but they are as seperate windows and since 3LB is not completely time-dependent, it doesn't vertically match up. Thus, I thought I'd impelement 3LB like TTM does. Anyway, I don't have a copy of the 3LB indicator to attach, but I am attaching my version.

My version compiles and attaches, but does not actually draw. I'm sure I'm just missing something stupid or doing something backwards, so it'd be nice to get another set of eyes on the code. Can anyone help me debug this thing?

-MRE-

Files:
 

For debugging MQ4 objects, they all appear in a list in Charts>Objects>Objects List (or use ctrl-b).

One issue I see is that you're using the same name for all the objects, which means you'll only create one object and just move it all over the place. You need to create a unique name for each object.

 

Help needed

After struggling for a while, i was finally able to get my indicator to print a vertical bar where i want it.

now the question is how to do what i want...

heres the idea

im placing a vertical line every 24hrs and i want to calculate the high, close, open and low inside every 2 vertical bars.i also need to find the range

"high-low"

any comments on how to start this? or what to read in order to grasp the idea?

thanks

 

How do I get this value right??

PM30=iCCI(NULL,30,3,0,0); PM30_1=iCCI(NULL,30,3,0,1);

This does not work??

Instead of giving the value of CCI 1 bar back - PM30_1=iCCI(NULL,30,3,0,1) - on the one minute graph I have placed the indicator on, it gives back the value of CCI 1 major step change back.

How do I get the value of this CCI 30 minute indicator 1 bar back on the 1 minute graph???

Would this be equivalent to iCCI(NULL,1,90,0,1) ?? This does not work either!

Need experts input - This has me puzzled!

Dave

 

I need some help...

im writing an EA that buys and sells the EMA crosses.. I want to filter it by checking if the last 10 bars closes were above the EMA before buying...

can anyone help me???