Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Identifier expected error CS1001

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Identifier expected error CS1001

    Hi,
    I have one indicator code that trying modify that:

    internal int Calc(double bbMacd, double supVal, double resVal, out bool LMacdOK, out bool SMacdOK)
    {
    bool item;
    bool flag;
    bool flag1;
    bool flag2;
    bool flag3;

    Some calculation here

    bool& lMacdOK=LMacdOK;
    if (flag4 || flag5)
    {
    flag2 = true;
    }
    else
    {
    flag2 = flag7;
    }
    *(lMacdOK) = flag2;
    bool& sMacdOK=SMacdOK;
    if (flag4 || flag5)
    {
    flag3 = true;
    }
    else
    {
    flag3 = flag6;
    }
    *(sMacdOK) = flag3;
    return 1;
    }
    }
    }

    After compile get below errors:
    Identifier expected Error CS1001. I got this error for below two lines:
    bool& lMacdOK=LMacdOK;
    bool& sMacdOK=SMacdOK;

    How to solve this?
    Regards,

    #2
    Hello RezaFx,
    Are you trying to evaluate the codes using an IF statement like in the below code
    Code:
    bool& lMacdOK=LMacdOK;
    If so then please modify the code as
    Code:
    if (bool& lMacdOK [B]==[/B] LMacdOK)
    {  
      //so something
    }
    If not then please send a toy NinjaScript code* replicating the behavior to support[AT]ninjatrader[DOT]com

    Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

    I look forward to assisting you further.

    *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
    Last edited by NinjaTrader_Joydeep; 12-26-2012, 08:16 AM.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Originally posted by RezaFx View Post
      Hi,
      I have one indicator code that trying modify that:

      internal int Calc(double bbMacd, double supVal, double resVal, out bool LMacdOK, out bool SMacdOK)
      {
      bool item;
      bool flag;
      bool flag1;
      bool flag2;
      bool flag3;

      Some calculation here

      bool& lMacdOK=LMacdOK;
      if (flag4 || flag5)
      {
      flag2 = true;
      }
      else
      {
      flag2 = flag7;
      }
      *(lMacdOK) = flag2;
      bool& sMacdOK=SMacdOK;
      if (flag4 || flag5)
      {
      flag3 = true;
      }
      else
      {
      flag3 = flag6;
      }
      *(sMacdOK) = flag3;
      return 1;
      }
      }
      }

      After compile get below errors:
      Identifier expected Error CS1001. I got this error for below two lines:
      bool& lMacdOK=LMacdOK;
      bool& sMacdOK=SMacdOK;

      How to solve this?
      Regards,
      Your code looks more like C than C#. Is that maybe the issue? What are the statements supposed to mean (in plain language rather than code)?

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by mgco4you, Today, 09:46 PM
      1 response
      2 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by wzgy0920, Today, 09:53 PM
      0 responses
      3 views
      0 likes
      Last Post wzgy0920  
      Started by Rapine Heihei, Today, 08:19 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Rapine Heihei, Today, 08:25 PM
      0 responses
      6 views
      0 likes
      Last Post Rapine Heihei  
      Started by f.saeidi, Today, 08:01 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X