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

Stop Loss Calculation on Dragging Line

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

    Stop Loss Calculation on Dragging Line

    Hello, im completly new to the Ninjatrader and they Script. I come from the Metatrader.
    I have worked the last year with a practical stop line on the chart that automatic calculate the lot size on a dollar amount between the line and the actual price, if i move the line over the price for short and if i drag the line under the price for long.

    is that possible to make a little strategy script that do this for me? also draw a movable line on the chart that calculate the position size for maximal dollar amount (maybe 250/ input variabel) between the line and the actual price and put the number automaticly in the chart trader?

    Thank you for help
    Best regards
    Orbito

    #2
    Hello orbito,

    Thanks for your post.

    It could be possible to draw a line on a chart and submit an order when the market price reaches that drawn line on the chart.

    Draw methods: https://ninjatrader.com/support/help...t8/drawing.htm

    If you are referring to a manually drawn line on the chart, you would need to loop through the DrawObjects collection to find the manually drawn line on the chart.

    DrawObjects: https://ninjatrader.com/support/help...rawobjects.htm

    Note that automatically calculating a lot size based on a dollar amount would require you to come up with custom logic to accomplish this. The quantity of the order submitted would be defined in your order Entry method when you call it, not in Chart Trader.

    NinjaTrader utilizes the C# programming language for developing indicators and strategies.

    The best way to begin learning NinjaScript is to use the Strategy Builder. With the Strategy Builder, you can set up conditions and variables and then see the generated code in the NinjaScript Editor by clicking the View Code button.

    Here is a link to our publicly available training videos, 'Strategy Builder 301' and 'NinjaScript Editor 401', for you to view at your own convenience.

    Strategy Builder 301 — https://www.youtube.com/watch?v=_KQF2Sv27oE&t=13s

    NinjaScript Editor 401 - https://youtu.be/H7aDpWoWUQs?list=PL...We0Nf&index=14

    I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:
    https://ninjatrader.com/support/help..._resources.htm

    If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:
    https://ninjatrader.com/support/help...g_concepts.htm

    And the MSDN (Microsft Developers Network) C# Language Reference.
    https://ninjatrader.com/support/help...erence_wip.htm


    Please let us know if we may further assist.​
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thank you for Answere. I have no idea how to code that. maybe anone can help me. that should not send a order if the price reach the line. the line are the stop pric so the calculation should be relatim from there to the actual price if i move the line. that can be a stop line drawing by the script but movable.

      Comment


        #4
        Did you actually do that in Metatrader ?

        Comment


          #5
          yes in Metatrader i have a indicator that shows the calculatet size and a script with hot key that send the order if i want

          Comment


            #6
            Hello orbito,

            Thanks for your note.

            In the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services in our support. This is so that we can maintain a high level of service for all of our clients as well as our partners.

            This means that it would be up to you to come up with the code logic to accomplish this.

            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. The link below could be used to find a list of affiliate consultants who would be happy to create this script or any others at your request.

            Search trading apps & services to cusomize your NinjaTrader platform with trading indicators, signals and strategies.


            This forum thread will also be open to other community members who may share their insights on the topic.

            Please let me know if I may assist further.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by burtoninlondon, Today, 12:38 AM
            0 responses
            10 views
            0 likes
            Last Post burtoninlondon  
            Started by AaronKoRn, Yesterday, 09:49 PM
            0 responses
            14 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Yesterday, 08:42 PM
            0 responses
            11 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Yesterday, 07:51 PM
            0 responses
            13 views
            0 likes
            Last Post strategist007  
            Started by StockTrader88, 03-06-2021, 08:58 AM
            44 responses
            3,983 views
            3 likes
            Last Post jhudas88  
            Working...
            X