MQL4 Learning - page 47

 

I tried, but a iCustom return a double.

There is another way?

thanks

 

TurnedUp and TurnedDown are internal variables and so you can't access them as is.

Create another buffer in bb stop indicator and assign a value when TurnedUp or TurnedDown are set then check it from your EA using iCustom.

Lux

 

new

hello all,

i'm completely new to metatrader and mql4 and am looking for an extensive programming course to learn the language. I've browsed a bit through here but i'm afraid i've missed it. I would like to learn to build expert advisors, either through manual programming or software rendering. I've got years experience in fx short term trading and find myself losing good health to it. Would like a robot to take over now ....beep!

Hope to hear from you and thanks.... Ed

 

Please add Data Buffer output

hello, just wondering if you guys would be able to add Data Buffer information to this indicator that only need to follow these rules;

if (red > 0 && blue < 0)

{trend = "SHORT (Strong)"; col = Red;}

else if (red > blue && (red > 0 && blue > 0))

{trend = "SHORT (Weak)"; col = Orange;}

else if (blue > 0 && red < 0)

{trend = "LONG (Strong)"; col = Blue;}

else if (blue > red && (blue > 0 && red > 0))

{trend = "LONG (Weak)"; col = DeepSkyBlue;}

The only buffers needed would be for TF's MN1, W1, D1, H4 and H1

When signal = NONE then buffer can be set = 0.

EG:

Buffer 0 - W1 (Sell Strong) = 1

Buffer 1 - W1 (Buy Strong) =1

Buffer 2 - D1 (Sell Strong) =1

Buffer 3 - D1 (Buy Strong) =1

etc.

Thank you

 

Account History Reports

Hello All,

I have programmed an EA that uses Limit orders instead of Market orders. Whenever a moving average changes, it uses the OrderModify function to alter the opening price of the order.

This works fine, however each time the order is adjusted (fairly frequently) the Account History has a new entry saying the order has been closed. This almost hides the real trades and the reports are very hard to read. Is there a method of customising the reports or account history so that it will only show the actual trades that have taken place, rather than "modified" orders?

Thanks for any replies

 

6 days moving average for Williams% Range

i am new forex and also learning to write the technical indicators

Hi

i am new here and glad to come across this site with some much news and information about forex trading.

i am currently using interbank FX platform which has most commonly used technical indicators but i am trying to figure out how to get the "6 days moving average for the Williams % Range" indicator

for metastock software the formula is very simple to set

it is : Mov(WillR(14),6,S )

but for metaquotes language, the formula seems much more complicating to understand

i saw the basic metaquotes language for williams % range being :

//----Williams?Percent Range calculation

i = Bars - ExtWPRPeriod - 1;

if(nCountedBars > ExtWPRPeriod)

i = Bars - nCountedBars - 1;

while(i >= 0)

{

double dMaxHigh = High;

double dMinLow = Low[Lowest(NULL, 0, MODE_LOW, ExtWPRPeriod, i)];

if(!CompareDouble((dMaxHigh - dMinLow), 0.0))

ExtWPRBuffer = -100*(dMaxHigh - Close) / (dMaxHigh - dMinLow);

i--;

}

//----

can anyone here help me to modify the above formula or better still come up with a new formula so that i can get the 6 days moving average for williams % range and also the original williams % range line, both together in the same window so that i can see the crossover of the two lines in the broker platform?

thanks

streamyx

 
streamyx:
i am new forex and also learning to write the technical indicators

Hi

i am new here and glad to come across this site with some much news and information about forex trading.

i am currently using interbank FX platform which has most commonly used technical indicators but i am trying to figure out how to get the "6 days moving average for the Williams % Range" indicator

for metastock software the formula is very simple to set

it is : Mov(WillR(14),6,S )

but for metaquotes language, the formula seems much more complicating to understand

i saw the basic metaquotes language for williams % range being :

//----Williams?Percent Range calculation

i = Bars - ExtWPRPeriod - 1;

if(nCountedBars > ExtWPRPeriod)

i = Bars - nCountedBars - 1;

while(i >= 0)

{

double dMaxHigh = High;

double dMinLow = Low[Lowest(NULL, 0, MODE_LOW, ExtWPRPeriod, i)];

if(!CompareDouble((dMaxHigh - dMinLow), 0.0))

ExtWPRBuffer = -100*(dMaxHigh - Close) / (dMaxHigh - dMinLow);

i--;

}

//----

can anyone here help me to modify the above formula or better still come up with a new formula so that i can get the 6 days moving average for williams % range and also the original williams % range line, both together in the same window so that i can see the crossover of the two lines in the broker platform?

thanks

streamyx

You might be able to do it by first attaching Williams R% and then dragging on to it the Moving Average indicator. Don't forget to select "apply to first indicator's data" in the settings.

Regards

 

A ea

Dear frineds:

I have several trades opened, i want to let the EA do the folloing. when the total profit reach a value it can close all the trades.

regards

 
amamil:
I am looking for information on how to apply two expert advisors at the same time. Is that possible or can you only put in two indicators.

only one ea per chart, but you may have as many charts of the same symbol. timeframe as you want. Don't forget to use MagicNumbers to differentiate the trades of eas working on the same pair.

 

How can I get other indicator's signal

How can I get other indicator's signal?

For Example:

A indicator

signal=OK

B indicator

If A indicator's signal=OK then ......

Thanks a lot!

Franky