# Get Color of Gator Indicator

Hi! I'm writing an EA that trades based on every indicator, and I'm at the gator indicator now. I already have a strategy to use it in my code but first I need to know the color of both the upper and the lower line, because the strategy is based on that. I would like a code that stores in two integer-type variables (one for the upper line and one for the lower one) the value "0" if the bar is green and the value "1" if the color is red.

Can anyone help?

There are no colors in code, only numbers. Stop thinking about colors.

As far as the gator is concerned, there are three lines: 0 - GATORJAW_LINE, 1 - GATORTEETH_LINE, 2 - GATORLIPS_LINE. You figure out which one is red on your settings.

William Roeder:

There are no colors in code, only numbers. Stop thinking about colors.

As far as the gator is concerned, there are three lines: 0 - GATORJAW_LINE, 1 - GATORTEETH_LINE, 2 - GATORLIPS_LINE. You figure out which one is red on your settings.

Yes, but how can I practically tell my EA: "If that is red, do this, if that is green, to that other thing"? I would like to be able to distinguish the "Value Up" and the "Value Down" colors of the indicator directly from my code.

revTolution :
Yes, but how can I practically  tell my EA: "If that is red, do this, if that is green, to that other thing"? I would like to be able to distinguish the "Value Up" and the "Value Down" colors of the indicator directly from my code.

There are no colors - :). The indicator color is an illusion. You need to know the algorithm of the indicator in order to make an assumption about its color.

There are no colors - :). The indicator color is an illusion. You need to know the algorithm of the indicator in order to make an assumption about its color.

Okay, I understand, but I need to do that, no matter if it's an illusion or not. I cannot find the source code of that indicator in the folder, can anyone write me some code please to let the EA distinguish the one that I see as a green line and the one I see as a red line?

revTolution:
Okay, I understand, but I need to do that, no matter if it's an illusion or not. I cannot find the source code of that indicator in the folder, can anyone write me some code please to let the EA distinguish the one that I see as a green line and the one I see as a red line?

Path: [data folder]\MQL5\Indicators\Examples\Gator.mq5