Coding help - page 652

 
stevenpun:

Thanks mladen ,

I think i have blind , i never saw the buffer 6 . Now it work perfectly  :)

I just make a quick test in ea tester , after testing i check on the "indicators list " .

It have load many time of the indicator , it this normal ?


stevenpun

No it is not normal

Check the types of the parameters used in iCustom() call (that error usually happens when the type of the parameter used in iCustom() call is not the same as in indicators parameters list)

 
mladen:

No it is not normal

Check the types of the parameters used in iCustom() call (that error usually happens when the type of the parameter used in iCustom() call is not the same as in indicators parameters list)

Still cant solve it , i try to copy the whole parameter from the indicator it still remain the same .

Mr mladen , is that can you help me to remove all the alert and time frame from the indicator ?

To make it "simple"  for ea use only .

 
stevenpun:

Still cant solve it , i try to copy the whole parameter from the indicator it still remain the same .

Mr mladen , is that can you help me to remove all the alert and time frame from the indicator ?

To make it "simple"  for ea use only .

I used this code :

//------------------------------------------------------------------
//
//------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 0
extern int     UpBandPrice          =     0;    // Upper Band Price(ex.2 for High)     
extern int     LoBandPrice          =     0;    // Lower Band Price(ex.3 for Low) 
extern int     MA_Length            =     6;    // Bollinger Bands Period
extern int     MA_Mode              =     0;    // Mode of Moving Average  
extern double  Deviation            =     1;    // Deviation
extern int     DeviationLength      =     20;    // Period of Standard Deviation
extern double  MoneyRisk            =     0.5;    // Offset Factor
extern int     SignalMode           =     1;    // SignalMode: Display signals mode: 0-only Stops,1-Signals & Stops,2-only Signals
extern int     LineMode             =     1;    // Display line mode: 0-no,1-yes  
extern int shift  =1;
//------------------------------------------------------------------
//
//------------------------------------------------------------------
int init()  { return(0); }
int start() 
{ 
   double trendCurr = iCustom(Symbol(),0,"BBands stop v3 MTF + limited bars",0,UpBandPrice, LoBandPrice, MA_Length, MA_Mode,Deviation,DeviationLength,MoneyRisk,SignalMode,LineMode,6,shift);
   double trendPrev = iCustom(Symbol(),0,"BBands stop v3 MTF + limited bars",0,UpBandPrice, LoBandPrice, MA_Length, MA_Mode,Deviation,DeviationLength,MoneyRisk,SignalMode,LineMode,6,shift+1); 
   Comment(trendCurr,"    ",trendPrev);
   return(0); 
}


for test, and all works OK

 
oguz:
Hi friends,
This is my ea and it now not open any orders!
Maybe problem is latest mt4 b988. Can you help me please?  

PS: My broker is now "instant type" Maybe it's codes not compatible instant type broker?
What errors do you get in the experts or journal tab of terminal?
 
mladen:

I used this code :


for test, and all works OK

I had test the code you post but still get the same problem .

I attach the ea , when you have a free time can you test it ?

And i have one more question about the TotalsOrder() .

I want the close all function to close only for the chart i attach .

As far as I know TotalsOrder() will return all Open Orders for all symbols, but how to get for specific currency pair ?

Try to get the answer from the internet but not really understand .

One of the code is count orders in the orders loop, but not sure where to place the code .


string symbol=Symbol();
int    orders_cnt=0;
int    total=OrdersTotal();
for(int i=0; i<total; i++)
{
    if(OrderSelect(i)==false) continue;
    if(OrderSymbol()==symbol) orders_cnt++;
}


Files:
BbandTest.mq4  34 kb
 
oguz:
Hi friends,
This is my ea and it now not open any orders!
Maybe problem is latest mt4 b988. Can you help me please?  

PS: My broker is now "instant type" Maybe it's codes not compatible instant type broker?

You just need to change the indicator name to " ptl 2_1 + alerts.mq4 " then it should work .

The ea iCustom call for this name .

 
stevenpun:

I had test the code you post but still get the same problem .

I attach the ea , when you have a free time can you test it ?

And i have one more question about the TotalsOrder() .

I want the close all function to close only for the chart i attach .

As far as I know TotalsOrder() will return all Open Orders for all symbols, but how to get for specific currency pair ?

Try to get the answer from the internet but not really understand .

One of the code is count orders in the orders loop, but not sure where to place the code .



stevenpun

It does not cause those errors on my terminal (it works as it should - loading only one instance of the indicator, no code change)

Also, the function you posted is OK, but you have to check if the OrderSymbol() is the same as Symbol() when you close the order too

 
stevenpun:

You just need to change the indicator name to " ptl 2_1 + alerts.mq4 " then it should work .

The ea iCustom call for this name .

It's original name is the same anyway.

New forum is changed it name to upload! 

 
mladen:
What errors do you get in the experts or journal tab of terminal?
I'm waiting any error to get journal tab...
 
oguz:
I'm waiting any error to get journal tab...
OK. When you do, please post the error that you get
Reason: