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

    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?

        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.

            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 -

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                65 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                41 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                23 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                26 views
                0 likes
                Last Post TheRealMorford  
                Started by Mindset, 02-28-2026, 06:16 AM
                0 responses
                52 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X