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

TimeStamp Issue !!!

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

    TimeStamp Issue !!!

    I am using NT 6.5 .14

    Here is my problem.

    TimeStamp is defined as a string.

    Here is the revelent code.

    private class LadderRow
    {

    public double Price;
    public int Volume;
    public string Time;



    public LadderRow(double myPrice, int myVolume, string myTime)
    {

    Price = myPrice;
    Volume = myVolume;
    Time = myTime;
    }

    -------------------------------------------------------------------
    else if (e.Operation == Operation.Update && e.Position < rows.Count)
    {

    rows[e.Position].Time = e.Time;
    rows[e.Position].Price = e.Price;
    rows[e.Position].Volume = e.Volume;

    }

    -----------------------------------------------------------------

    e,Time is a valid selection, see attachment.

    but when I compile, I get an error. CS0029.

    Can anyone explain this?

    Thanks,

    RJay
    Attached Files
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    #2
    RJay,
    I don't think e.Time is returned as a string, yet it was defined as such. Try e.Time.ToString. I haven't tried it, but I think that might be the issue.

    BTW, that will be code breaking in NT7, since e.Volume will be a long instead of an int

    VT

    Comment


      #3
      e.Time would be returned as DateTime, this why your code creates a compile issue.
      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Lumbeezl, 01-11-2022, 06:50 PM
      30 responses
      803 views
      1 like
      Last Post grayfrog  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      3 responses
      11 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by Johnny Santiago, 10-11-2019, 09:21 AM
      95 responses
      6,193 views
      0 likes
      Last Post xiinteractive  
      Started by Irukandji, Today, 09:34 AM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by RubenCazorla, Today, 09:07 AM
      1 response
      6 views
      0 likes
      Last Post RubenCazorla  
      Working...
      X