Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

why not convert double to string ???

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

    why not convert double to string ???

    hi guys why not convert double to string ?

    in line 110 ?


    #region Using declarations
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Gui;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.SuperDom;
    using NinjaTrader.Gui.Tools;
    using NinjaTrader.Data;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Core.FloatingPoint;
    using NinjaTrader.NinjaScript.DrawingTools;
    using System.IO;
    using System.IO.MemoryMappedFiles;
    #endregion

    //This namespace holds Indicators in this folder and is required. Do not change it.
    namespace NinjaTrader.NinjaScript.Indicators
    {
    public class Aziocane : Indicator
    {
    MemoryMappedFile file;
    private int nData = 0;
    private double bidPrice;
    private double askPrice;

    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "Aziocane";
    Calculate = Calculate.OnBarClose;
    IsOverlay = false;
    DisplayInDataBox = true;
    DrawOnPricePanel = true;
    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    PaintPriceMarkers = true;
    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
    //See Help Guide for additional information.
    IsSuspendedWhileInactive = true;
    }
    else if (State == State.Configure)
    {

    file = MemoryMappedFile.CreateOrOpen("Test", 1000, MemoryMappedFileAccess.ReadWrite);

    }
    else if (State == State.Terminated)
    {
    file.Dispose();
    }
    }


    protected override void OnBarUpdate()
    {
    //Add your custom indicator logic here.


    }

    protected override void OnMarketData(MarketDataEventArgs e)
    {
    if (e.MarketDataType == MarketDataType.Ask)
    {
    askPrice = e.Price;
    }


    try
    {

    // byte[] data = ASCIIEncoding.ASCII.GetBytes("35;2020.06.26 10.00.01;ASK;1,12445;1");
    string Armando= Double.ToString(e.Price );
    byte[] data = ASCIIEncoding.ASCII.GetBytes(Armando);


    }
    catch
    {
    Print("Data file busy...");
    }
    }
    }
    }
    }

    #region NinjaScript generated code. Neither change nor remove.

    namespace NinjaTrader.NinjaScript.Indicators
    {
    public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
    {
    private Aziocane[] cacheAziocane;
    public Aziocane Aziocane()
    {
    return Aziocane(Input);
    }

    public Aziocane Aziocane(ISeries<double> input)
    {
    if (cacheAziocane != null)
    for (int idx = 0; idx < cacheAziocane.Length; idx++)
    if (cacheAziocane[idx] != null && cacheAziocane[idx].EqualsInput(input))
    return cacheAziocane[idx];
    return CacheIndicator<Aziocane>(new Aziocane(), input, ref cacheAziocane);
    }
    }
    }

    namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
    {
    public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
    {
    public Indicators.Aziocane Aziocane()
    {
    return indicator.Aziocane(Input);
    }

    public Indicators.Aziocane Aziocane(ISeries<double> input )
    {
    return indicator.Aziocane(input);
    }
    }
    }

    namespace NinjaTrader.NinjaScript.Strategies
    {
    public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
    {
    public Indicators.Aziocane Aziocane()
    {
    return indicator.Aziocane(Input);
    }

    public Indicators.Aziocane Aziocane(ISeries<double> input )
    {
    return indicator.Aziocane(input);
    }
    }
    }

    #endregion


    #2
    Hello faustf

    For the price you can just use .ToString()
    e.Price.ToString();

    The other items you provided in the sample I am not certain what you are trying to do with that syntax, you may want to just try printing the value first as that would be a string:

    Print(e.Price.ToString());

    If you are seeing an error or still don't see the result that you wanted could you post more specific details on what the problem you are having with the string or what you were trying to do?

    I look forward to being of further assistance.



    Comment


      #3
      thankz so much

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      671 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      379 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      111 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      575 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      582 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X