Results 1 to 5 of 5
 0 Attachment(s)    

Thread: Getting Error ')' Parameter expected

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    12

    Default Getting Error ')' Parameter expected

    Hello Friends,

    Can any one help to find what is going wrong in this code? i am getting an error ')' Parameter expected when i compile.

    It will be great if someone help in this issue. Please see the code below
    *****************************************
    void comments()
    { string s0="", s1="", s2="", s3="", swap="", sCombo="", sStr ;
    int PipsProfit;
    double AmountProfit;
    PipsProfit=0; AmountProfit=0;
    PosCounter();
    if (b.ticket>0)
    { OrderSelect(b.ticket,SELECT_BY_TICKET);
    PipsProfit=NormalizeDouble(((Bid - OrderOpenPrice())/Point),Digits);
    AmountProfit=OrderProfit();
    }
    else if (s.ticket>0)
    { OrderSelect(s.ticket,SELECT_BY_TICKET);
    PipsProfit=NormalizeDouble(((OrderOpenPrice()-Ask)/Point),Digits);
    AmountProfit=OrderProfit();
    }
    if (Exit.On.Yellow) s0="Exit if Yellow on "+Exit.On.Yellow.Period+" min";
    else s0="";
    if (Move.To.BreakEven.at.pips>0) s1="s/l will move to b/e after: "+Move.To.BreakEven.at.pips+" pips and lock: "+Move.To.BreakEven.Lock.pips+" pips"+"\n\n";
    else s1="";
    if (Use.Juice) s2="Use Juice: Yes Juice.TimeFrame: "+Juice.TimeFrame+"\n";
    else s2="Use Juice: No";
    if (Use.Adx) s3="Use ADX: Yes ADX TimeFrame:"+Adx.TimeFrame +" Adx Threshold: "+Adx.Threshold+"\n";
    else s3="Use ADX: No";
    if (Use.Only.First2.Indicators) sCombo=Trigger.Period+"/"+Filter.Period.1;
    else sCombo=Trigger.Period+"/"+Filter.Period.1+"/"+Filter.Period.2;
    Comment( ScreenComment,"\n",
    "Today\'s Range: ",TodaysRange,"\n",
    "Combo Used: ",sCombo," ",s0,"\n",
    "s/l: ",StopLoss.Pips," tp:",TakeProfit.Pips," trail:",Trail.Pips,"\n",
    s1,"\n",
    s2,"\n",
    s3,"\n",
    "\n", "Pips: ",PipsProfit," / $ ", AmountProfit,
    );

  2. #2
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Hi anand1268,

    At the end, add a braces }

    And in the comment function, you have a useless comma before this );

  3. #3
    Junior Member
    Join Date
    Dec 2008
    Posts
    12

    Default

    Quote Originally Posted by funyoo View Post
    Hi anand1268,

    At the end, add a braces }

    And in the comment function, you have a useless comma before this );

    Hi Funyoo,

    Thanks for the quick reply.
    '}' i forget to paste in the thread.

    And if i take out this section from the code i have no errors. if i want to use then it always gives the error saying ) parameter expected, even if take away ;

    /*
    Comment( ScreenComment,"\n",
    "Today\'s Range: ",TodaysRange,"\n",
    "Combo Used: ",sCombo," ",s0,"\n",
    "s/l: ",StopLoss.Pips," tp:",TakeProfit.Pips," trail:",Trail.Pips,"\n",
    s1,"\n",
    s2,"\n",
    s3,"\n",
    "\n", "Pips: ",PipsProfit," / $ ", AmountProfit,
    );
    */

  4. #4
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by anand1268 View Post
    Hi Funyoo,

    Thanks for the quick reply.
    '}' i forget to paste in the thread.

    And if i take out this section from the code i have no errors. if i want to use then it always gives the error saying ) parameter expected, even if take away ;

    /*
    Comment( ScreenComment,"\n",
    "Today\'s Range: ",TodaysRange,"\n",
    "Combo Used: ",sCombo," ",s0,"\n",
    "s/l: ",StopLoss.Pips," tp:",TakeProfit.Pips," trail:",Trail.Pips,"\n",
    s1,"\n",
    s2,"\n",
    s3,"\n",
    "\n", "Pips: ",PipsProfit," / $ ", AmountProfit,
    );
    */
    Without the complete code, it's hard to know. I don't see any other errors.

    Maybe this function : PosCounter(), requires some parameters ?

  5. #5

    Lightbulb last comma is 1 too many

    Quote Originally Posted by anand1268 View Post
    Hello Friends,
    Can any one help to find what is going wrong in this code? i am getting an error ')' Parameter expected when i compile.

    Comment( ScreenComment,"\n",
    "Today\'s Range: ",TodaysRange,"\n",
    "Combo Used: ",sCombo," ",s0,"\n",
    "s/l: ",StopLoss.Pips," tp:",TakeProfit.Pips," trail:",Trail.Pips,"\n",
    s1,"\n",
    s2,"\n",
    s3,"\n",
    "\n", "Pips: ",PipsProfit," / $ ", AmountProfit,
    );
    Hi anand,
    As pointed out by Mr funyoo, you have a comma too many. It is the last 1 at the end of the comment() function.
    Straight after the AmountProfit close the brackets then a semi like this

    "\n", "Pips: ",PipsProfit," / $ ", AmountProfit);

    Could still leave the ); on its own line if you wanted.

    cheers bt2

Similar Threads

  1. Ex4 write error
    By fxtester in forum MQL programming
    Replies: 0
    Last Post: 12-04-2015, 19:47
  2. OrderClose error 138
    By fxtester in forum MQL programming
    Replies: 0
    Last Post: 02-11-2015, 21:39
  3. GPBUSD Bullish Movement is expected.
    By ronaldmfx in forum Technical analysis
    Replies: 0
    Last Post: 05-19-2014, 08:44
  4. ProFx parameter inputs
    By TREND RIDER in forum Ideas for manual systems
    Replies: 7
    Last Post: 11-27-2009, 23:51
  5. Where is error ?
    By przem81621 in forum MQL programming
    Replies: 2
    Last Post: 07-09-2009, 07:34

Tags for this Thread

adx, breakeven, indicators, stoploss

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •