How to code? - page 40

 

Help!

hello to everybody!

could someone tell me how to creat a condition like:

.......

while(when the price of GBP/USD>2.0000)

{.......}

.......

THANKS A LOTS!

 

It is something with iOpen, iClose and so on.

For example:

1.

iOpen(NULL,5,1)[/CODE]

It is open price for previous bar, M5 timeframe. Current symbol (pair on the chart.

2.

iClose("GBPUSD",PERIOD_H1,1)[/CODE]

It is close price for the previous bar (1), H1 timeframe (PERIOD_H1), for GBPUSD.

3. [CODE]iClose("GBPUSD",Pt,pr)

and in the setting:

[CODE]extern int pr=1;

extern int Pt=5;

It is close price for GBPUSD for pr bar (selectable in the settings) for Pt timeframe (selectable in the selling. Default is previous bar (pr=1) and default is M5 timeframe (Pt=5) in the settings.

 

Thanks a lot!

 

thanks

thanks a lot!

 

double bid = MarketInfo("GBPUSD",MODE_BID);

double ask = MarketInfo("GBPUSD",MODE_ASK);

 

Help needed - combining timeframes

I am trying to develop an EA that uses two signals:

1) An EMA based indicator from the D1 chart that indicates the major trend (long, short, or flat)

2) A MACD based indicator from the H4 chart that gives the trading signal (long or short)

I have developed both my custom indicators - they work fine in their respective charts. However, I am having difficulty combining them to work together as an EA

How do you go about combining timeframes in an EA?

Thanks.

CelticWarrior72

 

How to change position sign with 1 command

In mql4 what is the command to change the sign of a position with only one order? I mean, for example, if I'm long on EURUSD of 5000 I want to be short of 5000 with a operation..

Thanks

 

How many lots on the chart

Hi,

I have an EA attached to a chart - When this EA open a postion, is it possible to show on the chart, as a label for example, with how many lots did the EA enter the position ?

Example : I would like to show on my chart this sentence when the EA enter a position : EA buy 2.9 lots of EURUSD @ 1.4000

Anyone know How can i do that ?

Thanks

Regards

 

What's wrong with this code?

I'm battling with making my expert advisor do as I tell it to

I'm simply trying to keep hedge ratios roughly even

simply put close one Sell in profit at a time then close one Buy in profit at a time and keep alternating

my code includes an offset of 5 unhedged positions

My girlfriend and I are pulling our hair out!

We try as best we can to code this ourselves before we ask for help but we are getting absolutely no where!

Many thanks to this forum and to the people that have helped us we gratefully acknowledge, these people have really helped our learning curve

Files:
 

Have a look at these

I also struggle with the coding. I keep looking for ea's that do something similar to what I am trying to do.

I have attached some hedging ea's for you to look at. Is the hedge in a different currency? You may have to use MarketInfo() if that is the case.

Reason: