Questions from a "dummy" - page 242

 
lazarev-d-m:
We are not psychics, specify the signal, the first assumption is the signal is for mt5 and you signed up being an mt4 client
The signal seems to be suitable for mt4.

Skalping 1pips

 
Vitek87:
The signal seems to be suitable for mt4.

Skalping 1pips

Yes it should, the signal has 24 subscribers, do you have enough money to make a transaction, maybe the proportions are wrong?
 
lazarev-d-m:
Yes I should, the signal has 24 subscribers, do you have enough money to make the transaction, maybe the proportions are wrong?
can you tell me what at least the proportions should be?
 
Vitek87:
Can you tell me what the minimum proportions should be?

To open a trade with a volume of 0.01 lots, if you subscribe to that signal, you should have about $3,600 :)

And this is at the maximum (95%) load on the deposit.

Something like this.

 
Contender:

To open a trade with a volume of 0.01 lots, if you subscribe to that signal, you must have about $3,600 :)

And this is at the maximum (95%) load on the deposit.

Something like this.

Thank you kindly.
 

Can you tell me what's wrong?

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
//--- plot Deviation
#property indicator_label1  "Deviation"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- indicator buffers
double         Buffer[];

input int period=2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   SetIndexBuffer(0,Buffer,INDICATOR_DATA);
   return(0);
  }
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   int start=0;
   if(prev_calculated>0) start=prev_calculated-1;
   for(int i=start;i<rates_total;i++)
     {
     Buffer[i]=0;
     double Buf[];
     for(int q=i;q>i-period;q--)
      {
      Buf[q]=MathMax(MathMax(MathAbs(open[i-q]-high[i-q]),MathAbs(open[i-q]-low[i-q])),MathAbs(open[i-q]-close[i-q]));
      Print(q);
      Buffer[i]=Buffer[i]+Buf[q];
      }
     
     }
   return(rates_total);
  }

In the longest line Buf[q] somehow goes outside the array, how is it, it's dimensionless, isn't it?

2013.02.20 13:12:48 Deviation 2 (EURUSD,H1) array out of range in 'Deviation 2.mq5' (61,10)

 
lazarev-d-m:

Can you tell me what's wrong?

In the longest line Buf[q] is somehow out of range, how come it's dimensionless?

2013.02.20 13:12:48 Deviation 2 (EURUSD,H1) array out of range in 'Deviation 2.mq5' (61,10)

That's why it is dimensionless.

We have to set its size with ArrayResize() before using it

 
kPVT:

That's why it's dimensionless.

You have to size it with ArrayResize() before using

I think that in this case you can't set the final value, the buffer's volume should be equal to the actual rates_total, but the volume can't be set with a variable
 

An array cannot be infinite.

Having a quick look there are errors in the algorithm, e.g. here:

for(int q=i;q>i-period;q--)

the index of array q becomes negative.

Документация по MQL5: Основы языка / Переменные
Документация по MQL5: Основы языка / Переменные
  • www.mql5.com
Основы языка / Переменные - Документация по MQL5
 
lazarev-d-m:
I think that in this case you can't set the final value, the buffer volume should be equal to the actual rates_total, but the volume can't be set through a variable
Make ArrayResize(Buf, rates_total);
Reason: