Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

memory mapping test help

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

    memory mapping test help

    hi guys anyone can help me ? i try to create a memory map file by indicator script in NJ8 this is my code
    #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;
    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.
    byte[] data = Encoding.UTF8.GetBytes ("This is a test vvvvvvvvvvvvv");


    using (MemoryMappedViewAccessor accessor = file.CreateViewAccessor())
    {
    accessor.Write(0,data.Length);

    }
    }
    }
    }

    #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

    but when i try to read by my external program , return only this code
    https://ibb.co/sFGKbZh

    anyone can help me if i create correctly the memorymap file ???

    thankz
    att all


    #2
    Hello faustf,

    As a tip, to export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
    1. Click Tools -> Export -> NinjaScript...
    2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
    3. Click the 'Export' button
    4. Enter a unique name for the file in the value for 'File name:'
    5. Choose a save location -> click Save
    6. Click OK to clear the export location message
    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
    Below is a link to the help guide on Exporting NinjaScripts.
    http://ninjatrader.com/support/helpG...-us/export.htm


    This would fall outside of what is supported by NinjaTrader Support and is not documented in the NinjaTrader Help Guide.

    This thread will remain open for any community members that would like to assist with this unsupported code.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    672 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
    577 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