forked from nique_372/MQLArticles
46 lines
2.6 KiB
Markdown
46 lines
2.6 KiB
Markdown
# Estructura de herencias para LossProfit
| |
Hola, he cambiado el sistema para CLossProfit ahora trabajaremos con herencias y clases.. antiguamente trabajamos con una sola clase con ENUM.. para eleijir el tipo de "Max profit o loss" a superar lo cual imposibilita agregar mas tipos de maximas perdidas y ganancias, ahora si se puede.. el sistema de herencia creado es el siguiente.
| |
| |
| |
```
| |
CLossProfit (base abstracta)
| |
│
| |
├─ CLossProfitPercentage<CLossProfit> (cálculo por %)
| |
│ │
| |
│ ├─ CLossProfitBaseProfit<CLossProfitPercentage<CLossProfit>>
| |
│ │ ├─ CLossProfitMaxDaily<CLossProfitPercentage<CLossProfit>>
| |
│ │ ├─ CLossProfitMaxWeekly<CLossProfitPercentage<CLossProfit>>
| |
│ │ ├─ CLossProfitMaxMon<CLossProfitPercentage<CLossProfit>>
| |
│ │ ├─ CLossProfitMax<CLossProfitPercentage<CLossProfit>>
| |
│ │ └─ CLossProfitMaxDesdeBaajo<CLossProfitPercentage<CLossProfit>>
| |
│ │
| |
│ └─ CLossProfitBaseLoss<CLossProfitPercentage<CLossProfit>>
| |
│ ├─ CLossLossMaxDaily<CLossProfitPercentage<CLossProfit>>
| |
│ ├─ CLossLossMaxWeekly<CLossProfitPercentage<CLossProfit>>
| |
│ ├─ CLossLossMaxMon<CLossProfitPercentage<CLossProfit>>
| |
│ ├─ CLossLossMax<CLossProfitPercentage<CLossProfit>>
| |
│ └─ CLossLossMaxDesdeArriba<CLossProfitPercentage<CLossProfit>>
| |
│
| |
└─ CLossProfitMoney<CLossProfit> (cálculo por $)
| |
│
| |
├─ CLossProfitBaseProfit<CLossProfitMoney<CLossProfit>>
| |
│ ├─ CLossProfitMaxDaily<CLossProfitMoney<CLossProfit>>
| |
│ ├─ CLossProfitMaxWeekly<CLossProfitMoney<CLossProfit>>
| |
│ ├─ CLossProfitMaxMon<CLossProfitMoney<CLossProfit>>
| |
│ ├─ CLossProfitMax<CLossProfitMoney<CLossProfit>>
| |
│ └─ CLossProfitMaxDesdeBaajo<CLossProfitMoney<CLossProfit>>
| |
│
| |
└─ CLossProfitBaseLoss<CLossProfitMoney<CLossProfit>>
| |
├─ CLossLossMaxDaily<CLossProfitMoney<CLossProfit>>
| |
├─ CLossLossMaxWeekly<CLossProfitMoney<CLossProfit>>
| |
├─ CLossLossMaxMon<CLossProfitMoney<CLossProfit>>
| |
├─ CLossLossMax<CLossProfitMoney<CLossProfit>>
| |
└─ CLossLossMaxDesdeArriba<CLossProfitMoney<CLossProfit>>
| |
```
| |
| |
## Niveles
| |
1. CLossProfit: Clase abstracta pura.. que da la plantilla para cualquier tipo de maxima perdida o ganancia
| |
2. CLossProfitMoney y CLossProfitPercentage: Aqui al momento de instancia la clase se tendra que decidir por cual clase heredar para el calulo de la maxima perdida o ganancia.
| |
3. CLossProfitBaseProfit y CLossProfitBaseLoss: Clase que separa las maximas perdidas y ganancias.
| |
4. Implementacion final.
| |
|