Some operator expected

 

Hi,

I'm now in programming and I have this error with this function


void CheckEquityLoss()

{

    

    if ((AccountEquity() < AccountEquity()(1 - EquityLoss/100)))

    {

        if(filterMartingala) Chiusura();

        CloseAllBuy();

        CloseAllSell();

        

    }

}


in this function I want to close all trade if my floating loss is under a certain % of my equity (% based on my variable equityloss)

But when compile I had this error Some operator expected, how can I correct this?

thanks for help

 
Andrea Angelici:

Hi,

I'm now in programming and I have this error with this function


void CheckEquityLoss()

{

    

    if ((AccountEquity() < AccountEquity()(1 - EquityLoss/100)))

    {

        if(filterMartingala) Chiusura();

        CloseAllBuy();

        CloseAllSell();

        

    }

}


in this function I want to close all trade if my floating loss is under a certain % of my equity (% based on my variable equityloss)

But when compile I had this error Some operator expected, how can I correct this?

thanks for help

Hi,
the operator is missing between the AccountEquity() and (1 - EquityLoss/100)
 

Please edit your post (don't create a new post) and replace your code properly (with "</>" or Alt-S), or attach the original file directly with the "+ Attach file" button below the text box.

NB! Very important! DO NOT create a new post. EDIT your original post.

 
Andrea Angelici: in this function I want to close all trade if my floating loss is under a certain % of my equity (% based on my variable equityloss)
if ((AccountEquity() < AccountEquity()(1 - EquityLoss/100)))

  1. Edit your post, as requested.
  2. You have X()(Y) not X() * (Y).
  3. Obviously, X < 0.95 X will never be true. You need to remember what the equity was before opening. Only then can you test Xcurr < 0.95 Xprev.
Reason: