Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

SharpDXHelper/Wrapper sertical lines spacing

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

    SharpDXHelper/Wrapper sertical lines spacing

    I've modified Jim's SharpDXHelper/Wrapper from the user app share page.

    My version is attached below as txt file. Only the indicator not the full addon as I can't export it because of some log tab errors on DXHelper and DXMediaBrush.

    I want to specify the space vertically for the horizontal lines, for example with 5 ticks between each horizontal line.

    Here is the current output, with 1 tick interline spacing.

    Click image for larger version  Name:	imagy-image.jpg Views:	0 Size:	225.4 KB ID:	1281027

    The relevant snippet from lines 175-86

    Code:
    DXH.DrawLine(RenderTarget,
                                        "LineBrush",
                                        ChartPanel.X,
                                        chartScale.GetYByValue(i),
                                        ChartPanel.W,
                                        chartScale.GetYByValue(i),
                                        LineBrushWidth,
                                        //(DashStyleHelper)(j%4));
                                        //(DashStyleHelper)(j%1));
                                        //(DashStyleHelper)(1.4f));
                                        //DashStyleHelper.Solid);
                                        (DashStyleHelper.Solid));​


    I tested the commented out commands in the snippet above to get familiar.
    I did not find the sought out info for the task at hand.

    How can the spacing between horizontal lines be controlled in this context?
    For example setting it to be 5 ticks according to the instrument the indicator is loaded on.

    #2
    Hello Paul,

    Thank you for your inquiry.

    What log tab errors are you getting when trying to export? Please provide a screenshot of the full error messages.


    SharpDX.Direct2D1.RenderTarget.DrawLine() only draws a line between the specified points. It takes no arguments to specify spacing between two different DrawLine() objects.

    You will need to add custom logic to your script that will only draw a line 5 ticks after the previous line has been drawn.

    In the loop from your sample sript, you are using i+= TickSize which is one tick. You can use (5 * TickSize) which is 5 ticks.

    Please let us know if you have any other questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Thank you Gaby the solution worked.

      I added a User Input variable for convenience.

      Output

      Click image for larger version

Name:	interline2.png
Views:	57
Size:	370.4 KB
ID:	1281045

      It does export as addon, but not just the indicator (might have to do with addon requirements).
      Would you be able to test it on your end before I post it on the user apps share page?
      Here it is attached.

      Comment


        #4
        It works on my end.
        Attached Files

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,404 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        95 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        8 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        159 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        8 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X