Skip to content

Commit

Permalink
1.078 fixed minor bug "Minimum Distance Between"
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoCiaccio committed Sep 8, 2022
1 parent 1a0e502 commit 1389d00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Binary file modified Extend cBot.algo
Binary file not shown.
8 changes: 4 additions & 4 deletions Extend cBot/Extend cBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ExtendcBot : Strategy

public const string NAME = "Extend cBot";

public const string VERSION = "1.077";
public const string VERSION = "1.078";

#endregion

Expand Down Expand Up @@ -274,7 +274,7 @@ public void StrategyRun()
{

bool HaveAskDistance = upperTrade > 0 && Math.Abs(Math.Round(Ask - upperTrade, Symbol.Digits)) >= DistanceMin;
HaveAskDistance = HaveAskDistance && Math.Abs(Math.Round(Ask - lowerTrade, Symbol.Digits)) >= DistanceMin;
HaveAskDistance = HaveAskDistance && lowerTrade > 0 && Math.Abs(Math.Round(Ask - lowerTrade, Symbol.Digits)) >= DistanceMin;
HaveAskDistance = StrategyPositions.Length == 0 || MinDistanceTrades == 0 || HaveAskDistance;

if (SharedConditions && MyOpenTradeType != Extensions.OpenTradeType.Sell && HaveAskDistance)
Expand All @@ -289,8 +289,8 @@ public void StrategyRun()
else if (Sell)
{

bool HaveBidDistance = lowerTrade > 0 && Math.Abs(Math.Round(Bid - upperTrade, Symbol.Digits)) >= DistanceMin;
HaveBidDistance = HaveBidDistance && Math.Abs(Math.Round(Bid - lowerTrade, Symbol.Digits)) >= DistanceMin;
bool HaveBidDistance = upperTrade > 0 && Math.Abs(Math.Round(Bid - upperTrade, Symbol.Digits)) >= DistanceMin;
HaveBidDistance = HaveBidDistance && lowerTrade > 0 && Math.Abs(Math.Round(Bid - lowerTrade, Symbol.Digits)) >= DistanceMin;
HaveBidDistance = StrategyPositions.Length == 0 || MinDistanceTrades == 0 || HaveBidDistance;

if (SharedConditions && MyOpenTradeType != Extensions.OpenTradeType.Buy && HaveBidDistance)
Expand Down

0 comments on commit 1389d00

Please sign in to comment.