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

Need a bit of NS/C# coding help

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

    #16
    Originally posted by Cheech View Post
    Certainly no apologies are necessary.

    That is very cool code sir.

    I was surprised how close I got to it,albeit nowhere near as sophisticated. I only had four declarations missing. Of course I never would have figured out what was missing and how to code them without your very kind assistance, thank you.
    That you got that close just goes to show that contrary to your thinking, you can actually write code in the OOP way. After all, OOP is just a way of organizing code in a manner that ties the code more closely to the structure of the data, rather than the structure of the machine. All of which is to say, if you could write assembler, all you need to do is try to forget about how close you programmed to the hardware, and instead think of programming to the data.

    I am no spring chicken myself: I can remember programming FORTRAN on punch cards, on what I think may have been more ancient than an IBM360! At any event, it occupied a whole floor of the building, and had 1MB of memory. Heck, my smartphone is more powerful than that. I still have nightmares when I dropped the cards after an overnight print out of all the errors from the cards that I had had to type out and leave to be run. I would then debate if it were not simpler to retype my cards, than to try to arrange them correctly after I gathered them up.

    So see, you may have been doing dentistry with a sharp nail and a stone, where I may have been using a chisel and a stone, but barely better.

    All of which is to say, you are selling yourself short. One never quite loses the knack to write code. Just crack out some Google Fu or get some books, and off you go. I did it: so can you. If your bent is instruction rather than autodidactism, take a course.
    I think I will use your code as a base and see if I can correctly fit in all of the MA plots I'm using without the rest of the logic. Once I get that working I'll copy and paste it into my indi (copy/paste??? kind of a neat pair of words to replace "plagiarize").

    Thank you so much.
    No plagiarism involved. Take and use as you see fit. I gave away the code, so it is no longer mine.

    Comment


      #17
      Originally posted by koganam View Post
      I am no spring chicken myself: I can remember programming FORTRAN on punch cards, on what I think may have been more ancient than an IBM360! At any event, it occupied a whole floor of the building, and had 1MB of memory. Heck, my smartphone is more powerful than that. I still have nightmares when I dropped the cards after an overnight print out of all the errors from the cards that I had had to type out and leave to be run. I would then debate if it were not simpler to retype my cards, than to try to arrange them correctly after I gathered them up.
      Well, I must say that I am the one that jumped to a conclusion this time. Based on how quickly you put that code together I had you pegged for a "whipper-snapper" with either 2 double E's or CS degrees and 10 + years experience. Not to play one-up's-manship or in this case "I think I am at least as old as you", my tour with the 360/370 was the brunt of my experience. My starting point was a 1401 or maybe a 1410 with all of 16K which today fits on the head of a pin. In fact I can even recall wiring logic panels on a 402 (but I can't recall all of my grandchildren's names, a clear sign of ..., and I shudder to think, what ).

      I suspect the pre-360 scientific machine you mentioned was probably in the 7090 family, which if I recall correctly was refereed to as the "stretch". There was also another scientific machine introduced around the time of the 360 but I don't recall that number.

      You mean you didn't use card columns 73-80 on those 5081s for sequence numbers this way if you dropped them you could run them through an 085 sorter to put them back in sequence (except for the code you added without sequence numbers)? My first tools were also a rock and a chisel.

      All of which is to say, you are selling yourself short. One never quite loses the knack to write code. Just crack out some Google Fu or get some books, and off you go.
      At that time in a universe beyond, "The Principles of Ops" and "Theory of Ops" were always with me. Unfortunately today, due to a noticeable lack of electrical activity in the gray matter or shear laziness (or some of both), I don't see myself snuggling up with a .Net manual or such, therefore I don't see myself becoming a proficient programmer. I've resigned myself to be a "hacker" and ask for help from people like yourself when I get over my head. That's not to say that I would try to learn more, but won't be a tenacious as I used to be. Admitting that is in itself is a bit of a humbling experience.

      You seem to be one of the few (at least that I am aware of) that have been able to successful make the transition from procedural language programming to OOP. There were a number of studies done when this OO stuff was born that claimed very few procedural language programmers would be able to make the transition.

      It's possible that the company I was with before retiring (sent out to pasture to pick daisies would be more honest) read the same studies and decided rather then train a bunch of people all or most of which were destined to fail, they decide to outsource (off shore) all of this new development and leave the maintenance to the existing staff. A staff of about 65 was whittled down to about 8 in 2 years and those too were also outsourced soon after.

      Well, I guess I should get to work on fitting my code into yours. Thanks for allowing me the trip down memory lane.

      Have a great day and thanks again for the code.
      Last edited by Cheech; 07-17-2016, 02:14 AM.

      Comment


        #18
        Quick update.

        Originally posted by koganam View Post
        Take and use as you see fit. I gave away the code, so it is no longer mine.
        Hi koganam:

        Plugged my stuff into your code, works like a charm. Have to keep this code around, most definitely very reusable (but you already knew it would be both ).

        Now to retro fit it all into my other indicator.

        Quick question, what do you mean by the comment "by using the FQPN ..." ?

        Comment


          #19
          Originally posted by Cheech View Post
          ...
          Quick question, what do you mean by the comment "by using the FQPN ..." ?
          Fully Qualified Path Name.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by usazencort, Today, 01:16 AM
          0 responses
          1 view
          0 likes
          Last Post usazencort  
          Started by kaywai, 09-01-2023, 08:44 PM
          5 responses
          603 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by xiinteractive, 04-09-2024, 08:08 AM
          6 responses
          22 views
          0 likes
          Last Post xiinteractive  
          Started by Pattontje, Yesterday, 02:10 PM
          2 responses
          21 views
          0 likes
          Last Post Pattontje  
          Started by flybuzz, 04-21-2024, 04:07 PM
          17 responses
          230 views
          0 likes
          Last Post TradingLoss  
          Working...
          X