I'm having some issues with getting simple arrows to alternate in a custom MT4 indie. Here's the logic:
bool conditionA;
bool conditionB;
if (X > Y) {conditionA = true; conditionB =false;} Draw Arrow at Low of bar
conditionA only changes to false if conditionB is true;
if (Y > X) {conditionB = true; conditionA =false;} Draw Arrow at High of bar
conditionB only changes to false if conditionA is true;
After the first arrow up or down, only draw subsequent arrows if the condition is opposite the previous condition.
*******************************************************************************************
How can I get this to work properly, right now I have arrows going all over the place in both directions at the same bar, or an arrow in only one direction on all bars, no arrows whatsoever. I've gotten other indies to properly draw alternating arrows, but can't seem to get this logic to draw properly.
I've tried setting conditionA and B as bool buffers, but no way to setindex for bool buffer, I've tried assigning a double to A and B as 1 and 0, but that didn't work either. I've also tried using global variables to offset A and B, but no luck there. There is no price comparison, only 2 conditions that are T or F.
Can anyone post a simple code template to try out?
bool conditionA;
bool conditionB;
if (X > Y) {conditionA = true; conditionB =false;} Draw Arrow at Low of bar
conditionA only changes to false if conditionB is true;
if (Y > X) {conditionB = true; conditionA =false;} Draw Arrow at High of bar
conditionB only changes to false if conditionA is true;
After the first arrow up or down, only draw subsequent arrows if the condition is opposite the previous condition.
*******************************************************************************************
How can I get this to work properly, right now I have arrows going all over the place in both directions at the same bar, or an arrow in only one direction on all bars, no arrows whatsoever. I've gotten other indies to properly draw alternating arrows, but can't seem to get this logic to draw properly.
I've tried setting conditionA and B as bool buffers, but no way to setindex for bool buffer, I've tried assigning a double to A and B as 1 and 0, but that didn't work either. I've also tried using global variables to offset A and B, but no luck there. There is no price comparison, only 2 conditions that are T or F.
Can anyone post a simple code template to try out?