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

Custom Series Difference% to trade

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

    Custom Series Difference% to trade

    Hi All

    i need help in plotting a chart of difference % on chart for /CL-/NG. Also once I plot the difference should be able to place orders using an automated strategy. Example when the difference percentage started positive long /Cl . If it is Negative Short /Ng

    is is it possible ? If it is not related to this topic please move or suggest appropriate category

    thanks
    suresh

    #2
    Hello 2shureshk,

    Thank you for your note.

    While what you ask is possible, it might not be particularly useful, depending on the instrument pairs you choose. Those two particular instruments (CL and NG) trade at very different prices. If you're just comparing one to the other, the percentage difference wouldn't ever drop below zero, most likely. That being said, there are a number of indicators currently available that would allow you to chart the spread between two instruments (not necessarily by percentage, though). You can check those out on our User App Share here:



    I notice you've asked several times in the forums requesting code for similar sounding strategies - please note that while we can sometimes assist with example scripts, in the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.

    We've given you code samples previously that would apply here:

    https://ninjatrader.com/support/foru...wo-instruments
    https://ninjatrader.com/support/foru...ategy-analysis
    https://ninjatrader.com/support/foru...namic-variable

    You can use these as a reference to create a strategy as you've asked.

    For example, should you want the percentage of the spread you could modify one of those examples to use this logic in OnBarUpdate():

    //Get difference between the primary and secondary series
    double spread = Closes[0][0] - Closes[1][0];

    //calculate what percent the spread is of the primary dataseries' price
    double percentSpread = ((spread / Closes[0][0])*100);

    Additionally, you may 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. If you would like, I can have our Platform Sales team follow up with you with a list of professional NinjaScript Consultants who would be happy to create or assist you with this script or any others at your request.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the info. I have been looking for this info for a long time . As you said help is available but it is not really useful to develop the logic even after studying with high technical skills with some programming knowledge. If there are basic code examples available that would have been more helpful rather than theory , which is not an easy way to develop.

      I am willing to know about the programmer services to see if I can achieve my requirements. It will be an info call or discussion to find service and pricing. I
      I might not be taking the set ice, if I am not comfortable with service/price after discussion.

      please share the contact email or let me know the secure area to share my contact info

      thanks

      Comment


        #4
        Hello 2sureshk,

        Thank you for your reply.

        Please write into to PlatformSales[AT]NinjaTrader[DOT]Com directly to reach our Sales team. They can point you towards Ninjascript Consultants who would be happy to assist you.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sidlercom80, 10-28-2023, 08:49 AM
        166 responses
        2,234 views
        0 likes
        Last Post sidlercom80  
        Started by thread, Yesterday, 11:58 PM
        0 responses
        1 view
        0 likes
        Last Post thread
        by thread
         
        Started by jclose, Yesterday, 09:37 PM
        0 responses
        6 views
        0 likes
        Last Post jclose
        by jclose
         
        Started by WeyldFalcon, 08-07-2020, 06:13 AM
        10 responses
        1,414 views
        0 likes
        Last Post Traderontheroad  
        Started by firefoxforum12, Yesterday, 08:53 PM
        0 responses
        11 views
        0 likes
        Last Post firefoxforum12  
        Working...
        X