Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using System.Globalization.CultureInfo.InvariantCulture

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

    Using System.Globalization.CultureInfo.InvariantCulture

    HI i have a code that loops through DrawObjects, i have something like this

    if (draw is DrawingTools.Rectangle)
    {
    DrawingTools.Rectangle RectangleTemp = draw as DrawingTools.Rectangle;
    RectangleTag = draw.Tag;
    RectangleStartPrice = RectangleTemp.StartAnchor.Price;
    RectangleEndPrice = RectangleTemp.EndAnchor.Price;
    RectangleStartTime = RectangleTemp.StartAnchor.Time;
    RectangleEndTime = RectangleTemp.EndAnchor.Time;
    s.WriteLine("@NQ#BOX" + ";" + RectangleStartTime + ";" + RectangleStartPrice + ";" + RectangleEndTime + ";" + RectangleEndPrice + ";" + ChartPeriod); // Append a new line to the file
    }


    i see this sample

    DateTime AsiaSessionTime = DateTime.Parse("17:00", System.Globalization.CultureInfo.InvariantCulture) ;
    DateTime EuropeSessionTime = DateTime.Parse("02:00", System.Globalization.CultureInfo.InvariantCulture) ;

    how can i use it in the code for example

    RectangleEndTime = DateTime.Parse((RectangleTemp.EndAnchor.Time), System.Globalization.CultureInfo.InvariantCulture) ;​

    #2
    Hello MJGutierrez,

    Thanks for your post.

    Using DateTime.Parse() would be considered C# education services which would go beyond the level of support we would be able to provide.

    See this publicly available documentation for information about using the DateTime.Parse() method: https://learn.microsoft.com/en-us/do...e?view=net-7.0

    <ChartAnchor>.EndAnchor.Time will return a DateTime value that contains a Date, such as 10/26/2022, and a Time, such as 6:55:00 PM.

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X