[127] IF THEN ELSE Condition is working improperly for ON BAR UPDATE cases

 

For IF THEN ELSE Condition for ON BAR UPDATE checks,  ELSE should also be only executed for ON BAR UPDATE. It is working as ON TICK NOW, so taking action after each tick and not only during the cases where ON BAR UPDATE Is executed. This is bringing improper results. Example:



//------------------------

// Rule: CandCountS

//------------------------

   if (_sqIsBarOpen == true

      &&   sqMarketPositionIsShort(MagicShort1, "Current", "")

)

   {

      // Action #1

        CandlesInTradeCountS = (CandlesInTradeCountS + AssignVrbVleEntMlt2);



   } else {

      // Action #1

        CandlesInTradeCountS = AssignVrbVleEntMlt3;


   }


Action for ELSE is executed even when Market position above IS SHORT but the event is between Candles (first condition : "_sqIsBarOpen == true"  is not met)

Attachments
No attachments
  • Votes +1
  • Project AlgoWizard
  • Type Bug
  • Status Fixed
  • Priority Normal

History

p
#1

pitro

14.05.2020 01:15

Task created

p
#2

pitro

27.05.2020 20:20
I may have been not clear enough. For On bar open - it is checking IF and THEN when new bar is opened but ELSE is skipping   the whole  if (_sqIsBarOpen == true " rule. Following this it works per Tick. It sholud not when the whole IF THEN rule is set for On bar open.
TB
#3

Tomas Brynda

29.05.2020 08:30

Status changed from New to Fixed

Dw
#4

Diwi

24.06.2020 08:21
Voted for this task.

Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please