Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Syntax Errors

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

    Syntax Errors

    This issue was dealt with in another thread, however, the answers I was receiving took the wrong path. I need a new person to look/compile this script and get it co compile. I received several answers and none of them worked. This should be something simple, however, there are syntax error that error msgs that are not providing leads to where to go.

    I downloaded the script after updating the last answer which was the following (I added it but do not understand that section).
    [GridCategory("Parameters")]
    public int DmiPeriods
    {
    get { return dmiPeriods; }
    set { fast = Math.Max(1, value); }
    }



    Another simple question on unrelated note:

    I tried to add a condition:
    if (DM(DmiPeriods).DiPlus >= 20)

    error msg that I cant compare this variable to numeric value!!!

    how can I get around that?

    Thanks.
    Attached Files

    #2
    Sam, the script attached will compile - you would need to add the public property for your DMI value under 'Properties' in the script, not in the Strategy name space.
    Attached Files
    BertrandNinjaTrader Customer Service

    Comment


      #3
      thanks.

      the 2nd part of the question, I want to add this condition but syntax not allowed:
      && ((DM(BarsArray[1],DmiPeriods).DiPlus >= 20))

      Comment


        #4
        Please try comparing a double to a double, so 20.0 - would that compile?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          does not compile. u can test this? right?

          Comment


            #6
            Sorry, then please then this - && ((DM(BarsArray[1],DmiPeriods).DiPlus[0] >= 20.0)))

            You missed getting a double value from your DiPlus series.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thanks much. This compiles. One more question:
              in this example to reference SMA, I do this
              if (SMA(BarsArray[1], Fast)[0] > SMA(BarsArray[1], Slow)[0] -----

              how I reference CLOSE in the array? Thanks again. I am getting there..

              Comment


                #8
                You're welcome, with BarsArray you access the Close value actually, you could also directly use Closes -

                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by DJ888, 04-16-2024, 06:09 PM
                4 responses
                12 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by terofs, Today, 04:18 PM
                0 responses
                11 views
                0 likes
                Last Post terofs
                by terofs
                 
                Started by nandhumca, Today, 03:41 PM
                0 responses
                7 views
                0 likes
                Last Post nandhumca  
                Started by The_Sec, Today, 03:37 PM
                0 responses
                3 views
                0 likes
                Last Post The_Sec
                by The_Sec
                 
                Started by GwFutures1988, Today, 02:48 PM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Working...
                X