• 概述
  • 评论
  • 评论 (2)

Gradient

255 shades of profit. It is an original indicator for the MetaTrader 4 terminal, which creates a chart background with transition form one color to another.

It has a minimum of code, so it has almost no effect on the terminal platform performance.

It also contains a function of the color temperature of profit: the background color changes depending on the ratio of current profit to the account balance. More negative values produce more red shades, positive values produce more shades of blue. The attached video shows how it works.

Six parameters are used to make the gradient fill of the background: three colors (RGB) for the upper border of the graph, and the three colors for the bottom. Values 0 to 255 are used (lower or higher values are automatically set to 0 or 255), the depth of the fill is controlled by the Depth parameter.

Set the Profit_Temperature to true, and the indicator will change the background color depending on the current profit relative to balance. Profit is usually a small percent of balance, so the indicator includes a parameter Precent_Balance - the percent of balance taken into account in the calculation of the color temperature.

To enable the color temperature in the visual testing mode, add the following line to the Expert Advisor code:

if(IsVisualMode())GlobalVariableSet("FGRADIENT",AccountProfit()/AccountBalance());

 

无评论