SetIndexBuffer : add an buffer to an indicator - page 2

 
angevoyageur:

What is the actual buffer index ?

Buffer in the indicator : index = 3 

Indicator :    
SetIndexBuffer(3,Buffer,INDICATOR_DATA);

EA : 
   if (CopyBuffer(CPMHandle, 2, 0, 1, CPMBuffer) <=0) return;

But for the debug inside the EA I used the CPMBuffer var

Here's what is the value of the buffer inside the EA log, Buffer = 120 is showed from the indicator / the same buffer inside the EA = 0

2014.12.06 11:45:14     Core 1  2014.06.11 19:00:00   Buffer : 120
2014.12.06 11:45:14     Core 1  2014.06.11 19:00:00   1 : 0 / 2 : 4.5 / 3 : 2.5
 
blouf:

Buffer in the indicator : index = 3 

But for the debug inside the EA I used the CPMBuffer var

Here's what is the value of the buffer inside the EA log, Buffer = 120 is showed from the indicator / the same buffer inside the EA = 0

You have a bug somewhere. Difficult to help with code snippets only.
 
angevoyageur:
You have a bug somewhere. Difficult to help with code snippets only.
I'll post it later, it's a draft & not clean at all
 
blouf:
I'll post it later, it's a draft & not clean at all
2014.12.06 14:13:52     Core 1  too low available memory, 1279 Mb used
Even clean, may memory matter ? I mean, 'buffer' shows as a printf in the indicator, but seems not given to the ea. I wished I could send the results directly, without buffers.
 
blouf:

Buffer in the indicator : index = 3 

But for the debug inside the EA I used the CPMBuffer var

Here's what is the value of the buffer inside the EA log, Buffer = 120 is showed from the indicator / the same buffer inside the EA = 0

Try this. Change:

if (CopyBuffer(CPMHandle, 2, 0, 1, CPMBuffer) <=0) return;

to:

if (CopyBuffer(CPMHandle, 2, 0, 1, CPMBuffer) <0) return;

For some reason, in my tests, CopyBuffer always returns zero regardless of the number of elements copied.

 
Iceron:

Try this. Change:

to:

For some reason, in my tests, CopyBuffer always returns zero regardless of the number of elements copied.

Solved. It seems it really was memory, I had to rewrite the indicator algorithms inside the EA. Now, it's ok. Thank you.
Reason: