Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

FIB drawing tool displaying ticks not price

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

    FIB drawing tool displaying ticks not price

    Some one very kindly helped me add a further couple of FIB tools to the drawing tools part so that it was possible to hotkey without using a template.

    I now have multiple fibs all hot keyed so I don't have to go into it and change the template which I find very useful.

    At the moment the default fib tool shows the price against each of the levels.

    Is it possible to change this so it shows the ticks instead between each level?

    Below is a section of the code if it is possible could you please show me how to do this and I can change the rest to match this one.

    namespace NinjaTrader.NinjaScript.DrawingTools
    {

    public class BreadFibRetA : FibonacciRetracements
    {

    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    AnchorLineStroke = new Stroke(Brushes.DarkGray, DashStyleHelper.Solid, 1f, 50);
    Name = Custom.Resource.NinjaScriptDrawingToolFibonacciRet racements;
    Name = "Bread Fib Ret A";
    PriceLevelOpacity = 5;
    StartAnchor = new ChartAnchor { IsEditing = true, DrawingTool = this };
    EndAnchor = new ChartAnchor { IsEditing = true, DrawingTool = this };
    StartAnchor.DisplayName = Custom.Resource.NinjaScriptDrawingToolAnchorStart;
    EndAnchor.DisplayName = Custom.Resource.NinjaScriptDrawingToolAnchorEnd;
    }
    else if (State == State.Configure)
    {
    if (PriceLevels.Count == 0)
    {
    PriceLevels.Add(new PriceLevel(0, Brushes.DarkGray));
    PriceLevels.Add(new PriceLevel(20, Brushes.DodgerBlue));
    PriceLevels.Add(new PriceLevel(40, Brushes.CornflowerBlue));
    PriceLevels.Add(new PriceLevel(60, Brushes.SteelBlue));
    PriceLevels.Add(new PriceLevel(80, Brushes.DarkCyan));
    PriceLevels.Add(new PriceLevel(100, Brushes.DarkGray));
    }
    }
    else if (State == State.Terminated)
    Dispose();
    }
    }​


    Thanks in advance bread.

    #2
    Hello Mr Bread,

    Thank you for your post.

    Yes, it is possible. You would need to create your own custom logic for converting the prices into ticks. This can be done by dividing the price by the TickSize and using Math.Abs() to make sure there is a positive number.

    TickSize - https://ninjatrader.com/support/help...8/ticksize.htm

    Below is a link to a forum post demonstrating converting price to ticks:



    Please let me know if we can assist further. ​
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Gaby View Post
      Hello Mr Bread,

      Thank you for your post.

      Yes, it is possible. You would need to create your own custom logic for converting the prices into ticks. This can be done by dividing the price by the TickSize and using Math.Abs() to make sure there is a positive number.

      TickSize - https://ninjatrader.com/support/help...8/ticksize.htm

      Below is a link to a forum post demonstrating converting price to ticks:



      Please let me know if we can assist further. ​
      Gabby thanks for your reply;

      it is beyond me with regards how to exactly do this is there any way you can show me the code and where to attach it to in this and I can copy and modify to suit the rest i am sure.

      Thanks Bread

      Comment


        #4
        Hello Mr Bread,

        Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Showing you the code / coming up with the logic for you would be considering creating code.

        The link I provided has code demonstrating how you can convert the price to ticks in code, which you can use in your own script.

        If you are interested, 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 a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.
        Gaby V.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Jonker, Today, 01:19 PM
        0 responses
        1 view
        0 likes
        Last Post Jonker
        by Jonker
         
        Started by futtrader, Today, 01:16 PM
        0 responses
        5 views
        0 likes
        Last Post futtrader  
        Started by Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,791 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        844 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,296 views
        1 like
        Last Post jgualdronc  
        Working...
        X