Can someone explain why I'm getting a 4806 error code on CopyBuffer()? - page 2

 
Alain Verleyen #:

It's always necessary to provide technical details on a technical forum.

What do you think is the motivation of someone who knows the answers to post it ?

These trivial questions are boring for me. What motivates me is to learn something new, or to interact pleasantly with nice people. I have none of this here, sorry.

Also sometimes to not allow people to say wrong things, and this most of the time leads to unpleasant exchanges as most people are not able to take critics.

Wow. OK. You addressed none of your misunderstandings, nor did you respond to any of my questions that remain unaddressed. 

In this case your lack of grasp of the information I gave you is, I agree, boring. To bad I get nothing from you on the information I actually gave.

Oh well, if that's what I'm going to get -- not because of my attitude and arrogance, but because you were offended when I failed to show what you imagined would have been the proper deference to you as an expert -- so be it.

I'm getting things figured out without your help, it just sure would save me some time.

I'll go point by point on what, apparently, according to what you've said so far, will be our last "conversation"

Alain Verleyen #:

It's always necessary to provide technical details on a technical forum.

I did.

Alain Verleyen #:

What do you think is the motivation of someone who knows the answers to post it ?

I have no idea what you're on about. I asked questions because I do not have the answers. Instead of answering my questions you and William seem to have gotten butt-hurt and pouted. My questions remain unanswered while you posture that you know the answers but won't share them. That's what I see from this side.

Alain Verleyen #:

These trivial questions are boring for me. What motivates me is to learn something new, or to interact pleasantly with nice people. I have none of this here, sorry.

There's nothing trivial about my questions, and I'm tired of your dismissive CYA-ing. If you know the answers, show them. If you don't, cool, but don't make out like the questions are too "trivial" for you to bother with.

I'm the same about boredom and learning, except my ego isn't involved. I could care less about "pleasant" when measured against information content/value. Like I said, I found your attitude quite arrogant, as well as dismissive. With you that's fine if you share the information you have. If you don't want to share it, cool, it's yours, my loss. But arrogant+dismissive+refusing to add informative value+utter ignorance of who you're talking to = just really gets my goat and I don't stand for it.

Alain Verleyen #:

Also sometimes to not allow people to say wrong things, and this most of the time leads to unpleasant exchanges as most people are not able to take critics.

LMAO! Again, right back at ya big guy.
 
Millard Melnyk :


1. Publish the code correctly: use the button Code

2. Example iMA - works for INDICATORS and the '-shift' parameter is correct.

3. Let's see an example - the custom indicator MA Color N Bars uses a block of code with '-shift'.

Code:

//+------------------------------------------------------------------+
//| Filling indicator buffers from the MA indicator                  |
//+------------------------------------------------------------------+
bool FillArrayFromBuffer(double &values[],   // indicator buffer of Moving Average values
                         int shift,          // shift
                         int ind_handle,     // handle of the iMA indicator
                         int amount          // number of copied values
                        )
  {
//--- reset error code
   ResetLastError();
//--- fill a part of the iMABuffer array with values from the indicator buffer that has 0 index
   if(CopyBuffer(ind_handle,0,-shift,amount,values)<0)
     {
      //--- if the copying fails, tell the error code
      PrintFormat("Failed to copy data from the iMA indicator, error code %d",GetLastError());
      //--- quit with zero result - it means that the indicator is considered as not calculated
      return(false);
     }
//--- everything is fine
   return(true);
  }

4. The 'MA Color N Bars on a Chart.mq5' Expert Advisor displays the data of the custom indicator and the indicator itself on the chart.

5. All you need is to change the 'MA: horizontal shift' parameter in the advisor and compare two values: the value that the advisor displays on the screen and the indicator value in the 'Data window' window

 

Documentation on MQL5: Technical Indicators / iMA
Documentation on MQL5: Technical Indicators / iMA
  • www.mql5.com
iMA - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Vladimir Karputov #:

1. Publish the code correctly: use the button

2. Example iMA - works for INDICATORS and the '-shift' parameter is correct.

3. Let's see an example - the custom indicator MA Color N Bars uses a block of code with '-shift'.

Code:

4. The 'MA Color N Bars on a Chart.mq5' Expert Advisor displays the data of the custom indicator and the indicator itself on the chart.

5. All you need is to change the 'MA: horizontal shift' parameter in the advisor and compare two values: the value that the advisor displays on the screen and the indicator value in the 'Data window' window

 

Sorry, your reply is way off the mark. I reported no problem involving "-shift". I published code correctly using the "Code" feature. I also took screenshots where appropriate to illustrate what I was saying for clarity. I began with an example of the problem I asked about. Your example has nothing to do with it. So I'll respond to you in kind:

1. Compile the example code I originally provided from https://www.mql5.com/en/docs/indicators/ima.

2. Run the indicator on a chart using defaults and check the "values" array for size and contents.

3. Run the indicator on a chart using a positive value for "shift" and  check the "values" array for size and contents.

4. Run the indicator on a chart using a negative value for "shift" and  check the "values" array for size and contents.

5. Answer this question: 

Why are the sizes and contents of the "values" array after running CopyBuffer() exactly the same in all 3 cases?


Which just begs a related question: Why does changing the start_pos parameter of the CopyBuffer() function fail to make any difference to the size or contents of the array output by the function?

If you want to answer some unrelated question, that's your business, but please don't expect me to pretend that it's relevant here.

Documentation on MQL5: Technical Indicators / iMA
Documentation on MQL5: Technical Indicators / iMA
  • www.mql5.com
iMA - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

OK guys, I've had enough. I've got better things to do than deal with valueless griping, which is all this thread has turned out to be.

I'll answer my own question.

Q - Can someone explain why I'm getting a 4806 error code on CopyBuffer()?


A - No.


And if you disagree with that answer, SHOW YOUR EXPLANATION, don't just pretend you have one but -- because I'm too arrogant, or too much of a newbie, or too stupid (no one said it, but you know it crossed your minds), or whatever-the-eff other excuse -- it wouldn't be worth it for you to reveal the results of your amazing acumen (because I'm too dumb/arrogant/belligerent/troll-like/insidious to get it, right?)

This has all been so classic, sad, and a waste of my time except for the entertainment factor. I am glad to learn how to better deal with these kinds of shenanigans, but that's not what I came here for.

If I want this kind of treatment, I'll go pay my ex a visit.