Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

pairs trading automatically close both trades when unrealized profit =x

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

    pairs trading automatically close both trades when unrealized profit =x

    I know there must be a way to do this but I can't figure out how to do it with the strategy builder or the market analyzer. Lets say I have a spread trade where I am long one index and short another, I don't want a separate stop and take profit on either trade but to just close both of them at the same time. Alerts in the market analyzer always want to know which market you want to apply it to, and if you apply it to all, it will close the profitable trade but not the unprofitable trade. Is there any way around this without going into custom programming? Thanks in advance!

    #2
    Hello terminatorT1000,

    Thank you for your post.

    This wouldn't be possible with either the Strategy Builder, as that cannot submit trades to an added data series which would be necessary, nor would it be possible with a Market Analyzer alert. This would require a manually coded automated strategy, as you can only submit orders to a secondary series via a manually coded script. That would be the only way to manage both trades at the same time.

    I would suggest if you are interested in going this route that you go over this section of our help guide first:



    If you are in need of resources to assist you in learning to code NinjaScript Strategies by hand, I'm happy to provide you with those.

    You can also contact one of our professional NinjaScript Consultants or Educators who would be eager to create or modify a script at your request or assist you with your script. Please let me know if you would like a list of professional NinjaScript Consultants or Educators who would be happy to create or modify any script at your request or assist you in learning NinjaScript.

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X