Try as I might, I just can't wrap my head around CopyBuffer.
Straight from CopyBuffer - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5:
Can someone explain how this is not a transposition?
Try as I might, I just can't wrap my head around CopyBuffer.
Straight from CopyBuffer - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5:
Can someone explain how this is not a transposition?
Can you explain how this is transposed?
The array being copied into is in chronological/index order from left to right, with the oldest bar as 0 and the newest as ArraySize(array) - 1;
Reading the indicator buffer chronologically/in index order, we get a sequence of 0,1,2,3,4,5,6,7,8 (right to left).
If CopyBuffer works exactly as the diagram shows, then reading the array chronologically/in index order, we get a sequence of 0,1,2,3,4,8,7,6,5 (left to right).
So, indicator buffer = 0,1,2,3,4,5,6,7,8 vs. array = 0,1,2,3,4,8,7,6,5.
See it?
The array being copied into is in chronological/index order from left to right, with the oldest bar as 0 and the newest as ArraySize(array) - 1;
Reading the indicator buffer chronologically/in index order, we get a sequence of 0,1,2,3,4,5,6,7,8 (right to left).
If CopyBuffer works exactly as the diagram shows, then reading the array chronologically/in index order, we get a sequence of 0,1,2,3,4,8,7,6,5 (left to right).
So, indicator buffer = 0,1,2,3,4,5,6,7,8 vs. array = 0,1,2,3,4,8,7,6,5.
See it?
I understand reverse indexing. The diagram shows a transposition. 0,1,2,3,4,5,6,7,8 reversed would be 8,7,6,5,4,3,2,1,0 -- and vice-versa -- no problem. But if you reverse 8,7,6,5,4,3,2,1,0, (reverse indexing, oldest on left), it would not result in 0,1,2,3,4,8,7,6,5 like the diagram shows. I'm going to assume it actually works as you described, not the way the diagram shows.
I understand reverse indexing. The diagram shows a transposition. 0,1,2,3,4,5,6,7,8 reversed would be 8,7,6,5,4,3,2,1,0 -- and vice-versa -- no problem. But if you reverse 8,7,6,5,4,3,2,1,0, (reverse indexing, oldest on left), it would not result in 0,1,2,3,4,8,7,6,5 like the diagram shows. I'm going to assume it actually works as you described, not the way the diagram shows.
I understand reverse indexing. The diagram shows a transposition. 0,1,2,3,4,5,6,7,8 reversed would be 8,7,6,5,4,3,2,1,0 -- and vice-versa -- no problem. But if you reverse 8,7,6,5,4,3,2,1,0, (reverse indexing, oldest on left), it would not result in 0,1,2,3,4,8,7,6,5 like the diagram shows. I'm going to assume it actually works as you described, not the way the diagram shows.
CopyBuffer(...); //then ArraySetAsSeries(true);
That way everything is in order
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Try as I might, I just can't wrap my head around CopyBuffer.
Straight from CopyBuffer - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5:
Can someone explain how this is not a transposition?