Coding help - page 291

 
12BPRO:
Dear Sir MLADEN....

I am currently using this codes in my EA which is running on a M15 timeframe...

It will open a new order after M15 timeframe...

bool AddP()

{int _num=0; int _ot=0;

for (int j=0;j<OrdersTotal();j++)

{if(OrderSelect(j,SELECT_BY_POS)==true && OrderSymbol()==Symbol() && OrderType()<3 && ((OrderMagicNumber()==Magic) || Magic==0))

{

_num++;if(OrderOpenTime()>_ot) _ot=OrderOpenTime();

}

}

if(_num==0) return(true);

if(_num>0 && ((Time[0]-_ot))>0)

return(true);

else return(false);

}

Could you alter this code to make an order for every 5 minute past the previous order....

although I am on a M15 timeframe....

HOPE YOU ARE NOT OFFENDED BY SENDING SO MANY QUESTION....

best regards

AZRUL...

AZRUL

Try replacing this

if(_num>0&& ((Time[0]-_ot))>0)with this

if(_num>0&& ((TimeCurrent()-_ot*)>PERIOD_M5*60))

 
mladen:
AZRUL

Try replacing this

if(_num>0&& ((Time[0]-_ot))>0)with this

if(_num>0&& ((TimeCurrent()-_ot*)>PERIOD_M5*60))

Dear Sir MLADEN,

Once again your TIME AND EXPERTISE is highly appreciated.... 3rd credits...

I will patch all the codes that you have written and try the simulation (tester) again tomorrow...

HAVE A NICE WEEKEND Dear SIR.....

yours truly

AZRUL....

 

Can someone make this Indikotor (TrendMA2000) change in mt4

Meta: Shortcode ( "TrendMA2000" ),

Subchart ( False );

Inputs:

Period ( 3, 1, 100 );

Variables:

avg, myavg, color;

avg = (( High + Low + High[1] + Low[1] + High[2] + Low[2] + High[3] + Low[3] + High[4] + Low[4] ) / 10 );

myavg = AVERAGE ( avg, Period );

If myavg > myavg[1] then color = DarkGreen

Else

If myavg <= myavg[1] then color = Red;

DrawLine ( myavg, "Trend", StyleSolid, 2, color, color );

danke mahatma

 
mahatma:
Can someone make this Indikotor (TrendMA2000) change in mt4

Meta: Shortcode ( "TrendMA2000" ),

Subchart ( False );

Inputs:

Period ( 3, 1, 100 );

Variables:

avg, myavg, color;

avg = (( High + Low + High[1] + Low[1] + High[2] + Low[2] + High[3] + Low[3] + High[4] + Low[4] ) / 10 );

myavg = AVERAGE ( avg, Period );

If myavg > myavg[1] then color = DarkGreen

Else

If myavg <= myavg[1] then color = Red;

DrawLine ( myavg, "Trend", StyleSolid, 2, color, color );

danke mahatma

mahatma

that is simply a sma(sma9median,5),period) (a simple moving average of a 5 period simple moving average)

 

EA from Japan that you can upload an indicator you want.

There are some Japanese in a property but this EA is able to upload an indicator you want to use.

It's going to be very interesting If anyone here can modify this EA.

Files:
pu_arrow.ex4  36 kb
 
hanaumabay:
There are some Japanese in a property but this EA is able to upload an indicator you want to use. It's going to be very interesting If anyone here can modify this EA.

Hi Hanaumabay, would need the non-decompiled source code before it can be modified.

 

Prior Day High-Low "Excluding Sundays"

Dear Sir MLADEN,

I have been unable to find an indicator that simply plots the prior day's High and Low excluding Sundays. I have been using the attached indicator and was hoping that it could be modified to exclude Sunday's data. Thank you in advance for your assistance.

Files:
 
mrtools:
Hi Hanaumabay, would need the non-decompiled source code before it can be modified.

It was able to open source file before.......I try look for an original

 

Dear Sir MLADEN,

Good morning Sir,

I am trying to avoid my EA from reopening an order after it trigger a trailing stop... but unfortunately the codes doesn't work as expected... I hope you could rectify the problem for me....

double closedAtTS() {

datetime lastTime = 0;

for(int i=OrdersHistoryTotal()-1; i>=0; i--)

{

if (OrderSelect(i,SELECT_BY_POS, MODE_HISTORY)==false) break;

if (Magic!=0)

if (OrderMagicNumber() != Magic) continue;

if (OrderSymbol() != Symbol()) continue;

if (OrderClosePrice()== OrderStopLoss()) continue;

if (OrderCloseTime() <= lastTime) continue;

lastTime = OrderCloseTime();

}

return(lastTime);

}

It seem that something is missing or this part of the equation doesn't do the trick...

if (OrderClosePrice()==OrderStopLoss()) continue;

As always your expertise is highly appreciated....

best regards

AZRUL.....

 

Dear Sir MLADEN,

Yup.... it was this part of the equation doesn't do the trick...

if (OrderClosePrice()==OrderStopLoss()) continue;

it should be...

if (OrderClosePrice() !=OrderStopLoss()) continue;

I was confuse with this

OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);

Sorry.... for this POST...

Thanks