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 sjsj2732, Yesterday, 04:31 AM
    0 responses
    30 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    286 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    282 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    132 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    90 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X