Created
January 2, 2019 12:09
-
-
Save rubens-shoji/948230c623e4be55f7bd1a2e638bffd5 to your computer and use it in GitHub Desktop.
Exemplo usando a classe PositionInfo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include no topo | |
#include <Trade\PositionInfo.mqh> | |
// declaracao no topo | |
CPositionInfo Position; | |
// OnInit ou OnTick | |
Position.SelectByIndex(0); | |
double Distancia = Position.PriceOpen() - Position.PriceCurrent(); | |
// se for negativo multiplica por -1 | |
if (Distancia < 0) Distancia = Distancia * -1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment