Errors, bugs, questions - page 2531

 
Aleksey Vyazmikin:

It's a pity that we didn't even dare to take part in the tests. The topic is interesting in my opinion, because it turns out that different processors handle different tasks differently, but there are not enough statistics yet.

My rarity processor is only left in my possession and in a museum, it is hardly of interest to anyone.

 
Aleksey Vyazmikin:

It's a pity that you didn't even dare to take part in the tests.

Wanted to run a test on the first day, but the thread has grown to several pages, some bugs in the first version of the test code ... did not read further, my own interests

I think I need a clear manual (with pictures ) and a minimum of thinking on what to do for the user, then the user activity may appear

 
Igor Makanu:

I wanted to run the test on day one, but the thread grew to several pages, some bugs with the first version of the test code... I did not want to read any further, got interested in my own interests

I think I need a clear manual (with pictures) and a minimum of thinking on what to do for the user, then the user activity may appear

And the forum itself is very uncomfortable for something like this, we need the opportunity for the author of the topic to edit the first post at the end of any period, where all the necessary, relevant information is located, rather than search among the mass of messages. In this format, it's just a thread for flubbing.

 

Here's a question.

I need to store a pointer to an array of type double[] (usual, indicator) so that it can be referenced within the program.

The standard developers suggest either to pass a reference to this array throughout the function hierarchy, cluttering up the input parameters where it is absolutely unnecessary, or to copy the entire array to itself onevery tick, and then use a reference to its internal array, which can be passed and remembered and used within the function hierarchy.

Both solutions seem very ugly to me. Passing a reference through the entire call tree is already ugly, and when you consider that we don't know at what point we might need to access the array, it just becomes really stupid.

Copying the entire array on every tick, when there is a source one, is also a bit of a mindset, and most importantly, it loses productivity.

Has anyone encountered this problem ? How to get around this stupid limitation ?

I remember once, I think,fxsaber suggested an address copying function using some shamanic action, but I can't find it.

Who can suggest what ?

 
Vict:

My rarity processor is only in my possession and in a museum, it's hardly interesting for anyone.

It's always interesting to assess progress.


Igor Makanu:

I wanted to run the test on the first day, but the thread has grown to several pages, some bugs with the first version of the test code... I did not read further and got busy with my own interests

I think I need a clear manual (with pictures ) and a minimum of thinking on what to do for the user, then the user activity may appear

There shouldn't be any bugs there, the others are running fine. Now there is a screenshot of how the strategy tester should be set up.

I didn't think it would be difficult to set up the optimiser at all... What's not clear there now - let me give you a hint.


Vict:

And the forum itself is very uncomfortable for something like this, we need the ability for the author of the topic to edit the first post at the end of any period, where all the necessary, relevant information is located, rather than searching among the masses of posts. In this format, it's just a thread for flubbing.

We don't have another forum, I update the results regularly when there is information - it's not that hard to find.

 
Georgiy Merts:

Here's a question.

I need to store a pointer to an array of type double[] (usual, indicator) so that it can be referenced within the program.

The standard developers suggest either to pass a reference to this array throughout the function hierarchy, cluttering up the input parameters where it is absolutely unnecessary, or to copy the entire array to itself onevery tick, and then use a reference to its internal array, which can be passed and remembered and used within the function hierarchy.

Both solutions seem very ugly to me. Passing a reference through the entire call tree is already ugly, and when you consider that we don't know at what point we might need to access the array, it just becomes really stupid.

Copying the entire array on every tick, when there is a source one, is also a bit of a mindset, and most importantly, it loses productivity.

Has anyone encountered this problem ? How to get around this stupid limitation ?

I remember once, I think,fxsaber suggested an address copying function using some shamanic action, but I can't find it.

Who can suggest what ?

If we are talking about mql5, we could wrap the indicator in a class and, if necessary, pull it, and in that class we organize copying and storing of necessary data to the needed ngbin and controlling its single update at every tick. I do it this way.
 
Vladimir Simakov:
If we are talking about mql5, then, as an alternative, we turn the indicator into a class and, if necessary, fetch it and use it for storing and copying necessary data to the needed ngbin and controlling its single update at every tick. I do it this way.

That's what I usually do myself...

But it doesn't work with indicator buffers. Or did I miss something and it can be done somehow?

 
Georgiy Merts:

But with indicator buffers, the wrap does not go away.

It always did.
 
Georgiy Merts:

But with the indicator buffers, the wrapping doesn't go through. Or did I miss something, can it be done somehow?

everything works, but arrays that will be indicator buffers should be described with public modifier

I created one HMA indicator for MQL4 - 4 indicators in one subwindow:

CHMA *hma[4];
int OnInit()
  {
//--- indicator buffers mapping
   int i=0;
   hma[0] = new CHMA(4,PeriodInd1,Method1,Price1,Shift1);
   hma[1] = new CHMA(3,PeriodInd2,Method2,Price2,Shift2);
   hma[2] = new CHMA(2,PeriodInd3,Method3,Price3,Shift3);
   hma[3] = new CHMA(1,PeriodInd4,Method4,Price4,Shift4);

   IndicatorBuffers(16);
   IndicatorSetDouble(INDICATOR_MINIMUM,0.0);
   IndicatorSetDouble(INDICATOR_MAXIMUM,5.0);
   IndicatorSetInteger(INDICATOR_HEIGHT,IndHeight);
   while(i<8)       { SetIndexBuffer(i,hma[int(i/2)].Uptrend); SetIndexBuffer(i+1,hma[int(i/2)].Dntrend); i+=2; 			}
   for(i=0;i<4;i++) { SetIndexBuffer(i+8,hma[i].ExtMapBuffer); SetIndexBuffer(i+12,hma[i].vect); 					}
   for(i=0;i<8;i++) { SetIndexStyle(i,DRAW_ARROW,EMPTY,ArrowWidth, i%2==0 ? ArrowColor1 : ArrowColor2); SetIndexArrow(i,ArrowCode); 	}
   for(i=8;i<17;i++){ SetIndexStyle(i,DRAW_NONE);											}
   IndicatorShortName("");
   IndicatorDigits(0);
//---
   return(INIT_SUCCEEDED);
  }

and the class itself where the body of the old indicator was just copied:

class CHMA
  {
private:
   int               period_,shift_,p,level_;
   ENUM_APPLIED_PRICE price_;
   ENUM_MA_METHOD    method_;
   double            GetWMA(int x,int per){ return(iMA(NULL,0,per,0,method_,price_,x+shift_)); }
public:
   double            ExtMapBuffer[],vect[],Uptrend[],Dntrend[];
                     CHMA(int level,int period,ENUM_MA_METHOD method,ENUM_APPLIED_PRICE price,int shift);
   void              calcind(int lim,int prevcalculated);
   int               lastvalue();
  };

the yellow color is the old indicator buffers, I didn't want to change the code of the old indicator at all, I just copied it to the class, it took me a little less than an hour

 
TheXpert:
always did.

What do you mean ? You can declare a class member as an indicator array ???

I'll check it now.

Hmmm... Right...

Well, then - everything is much simpler, and the question is solved without any problems - we declare class members as indicator arrays, and pass a pointer to this very class for memorizing. The solution, of course, is not very nice, but in the absence of pointers to the array, it's OK.

Reason: