Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Editing an existing indicator.

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

    Editing an existing indicator.

    Hi, wanted to make a custom version of Pivots indicator, but I get this error:
    FloorPivots.cs The namespace '<global namespace>' already contains a definition for 'HLCCalculationMode' CS0101 477
    FloorPivots.cs The namespace '<global namespace>' already contains a definition for 'PivotRange' CS0101 485 13
    I've made a copy of Pivots indicator using Save as... in the Script Editor, and only change the formula, nothing more.

    How can I get this compiled?

    Thanks in advance.

    #2
    Hello chinook77,

    Thanks for your post.

    There are two approaches you can take here.

    If you do not intend to share this indicator then the simple answer is to delete (or comment out) lines 476 - 490. What you are deleting are public enums that have already been created/defined in the original pivots indicator file. As they are created in the indicator namespace, they are already available to any indicator that uses them and this is why you get the error messages (indicating they are already defined).

    If you intend to share your indicator, then you would need to rename the enums, for example from public enum HLCCalculationMode to something like public enum myHLCCalculationMode. You would then have to go through the script and replace every instance of HLCCalculationMode with the new myHLCCalculationMode

    Comment


      #3
      Solved, thank you for the quick replay.

      Best regards.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      81 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      68 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      55 views
      0 likes
      Last Post CarlTrading  
      Working...
      X