Skip to content

Commit

Permalink
Merge pull request #8 from erlonfs/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
erlonfs authored May 28, 2017
2 parents 26c942e + af1968d commit ba9566b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Binary file modified first_candle.mq5
Binary file not shown.
12 changes: 7 additions & 5 deletions src/FirstCandle.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ private:
double _maxima;
double _minima;

bool _waitBuy;
bool _waitSell;
bool _wait;
int _qtdCopiedRates;

//Grafico
Expand All @@ -43,7 +42,7 @@ private:
if (GetPrice().last >= _entrada) {

if (!HasPositionOpen()) {
_waitBuy = false;
_wait = false;
Buy(_entrada, _auxStopLoss, _auxStopGain, getRobotName());
}

Expand All @@ -63,7 +62,7 @@ private:
if (GetPrice().last <= _entrada) {

if (!HasPositionOpen()) {
_waitSell = false;
_wait = false;
Sell(_entrada, _auxStopLoss, _auxStopGain, getRobotName());
}

Expand Down Expand Up @@ -200,7 +199,10 @@ public:
ClearDraw(_maxima);
ClearDraw(_minima);

if (FindCondition()) {
if (_wait || FindCondition()) {

_wait = true;

Draw(_minima, _corSell);
Draw(_maxima, _corBuy);

Expand Down

0 comments on commit ba9566b

Please sign in to comment.