NexusFi: Find Your Edge


Home Menu

 





Flatten everything once unrealized P/L reaches a certain number


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one runit with 13 posts (0 thanks)
    2. looks_two sam028 with 7 posts (7 thanks)
    3. looks_3 pstrusi with 2 posts (0 thanks)
    4. looks_4 CannonTrading with 1 posts (1 thanks)
    1. trending_up 5,318 views
    2. thumb_up 8 thanks given
    3. group 5 followers
    1. forum 22 posts
    2. attach_file 1 attachments




 
Search this Thread

Flatten everything once unrealized P/L reaches a certain number

  #11 (permalink)
 runit 
Toronto, Ontario/Canada
 
Experience: Intermediate
Platform: TOS
Trading: stocks
Posts: 38 since Dec 2014
Thanks Given: 10
Thanks Received: 3


sam028 View Post
For this specific need it's going to be too long to explain step by step, and if you're not experienced this kind of strategy is a bit dangerous.
If I have some free time I'll put a functional example in this thread.

Thank you, I would really appreciate that.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #12 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


runit View Post
Thank you, I would really appreciate that.

Try this strategy, test it carefully in sim mode first!
CloseIfPnL.cs

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #13 (permalink)
 runit 
Toronto, Ontario/Canada
 
Experience: Intermediate
Platform: TOS
Trading: stocks
Posts: 38 since Dec 2014
Thanks Given: 10
Thanks Received: 3



sam028 View Post
Try this strategy, test it carefully in sim mode first!
Attachment 280527

Thank you, will try tomorrow

Started this thread Reply With Quote
  #14 (permalink)
 runit 
Toronto, Ontario/Canada
 
Experience: Intermediate
Platform: TOS
Trading: stocks
Posts: 38 since Dec 2014
Thanks Given: 10
Thanks Received: 3


sam028 View Post
Try this strategy, test it carefully in sim mode first!
Attachment 280527

Btw, does Ninja have to be running for this strategy to execute, or will it execute even if my computer falls asleep, for example?

Started this thread Reply With Quote
  #15 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


runit View Post
Btw, does Ninja have to be running for this strategy to execute, or will it execute even if my computer falls asleep, for example?

Ninja has to be running.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #16 (permalink)
 runit 
Toronto, Ontario/Canada
 
Experience: Intermediate
Platform: TOS
Trading: stocks
Posts: 38 since Dec 2014
Thanks Given: 10
Thanks Received: 3


sam028 View Post
Try this strategy, test it carefully in sim mode first!
Attachment 280527

Unfortunately, this strat doesn't work

If you have other ideas, I'd love to test them out

Started this thread Reply With Quote
  #17 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


runit View Post
Unfortunately, this strat doesn't work

If you have other ideas, I'd love to test them out

Well, I coded and tried it before sharing it, and it worked as expected...

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #18 (permalink)
 runit 
Toronto, Ontario/Canada
 
Experience: Intermediate
Platform: TOS
Trading: stocks
Posts: 38 since Dec 2014
Thanks Given: 10
Thanks Received: 3


sam028 View Post
Well, I coded and tried it before sharing it, and it worked as expected...

Perhaps I didn't set it up correctly?

I select the strat, it's asking me to enter the instrument, say I picked /MES, and pick the P/L target - say $100.

Next, I select the strat (wait until flat), check the box, and open my positions. Say 1 contract, of /NQ, 1 contract of /ES and 1 contract of /MES.

When the P/L reached $100, all of the positions didn't close. They only closed when the P/L of /MES reached $100 it seems (maybe something else triggered it, but I assume that's what happened, because it went flat at $200+ profit)

What am I doing wrong?

Started this thread Reply With Quote
  #19 (permalink)
pstrusi
Lalin Pontevedra Spain
 
Posts: 20 since Sep 2013
Thanks Given: 10
Thanks Received: 9


runit View Post
Is it possible to automatically set NT8 to flatten all of my account positions once the unrealized P/L reaches a certain $ value? And if so, does the platform need to continue running on the computer?

Thank you!


Stop Profit/Loss orders would accomplish your goal, unless, for some reason, you don't want to have working stops orders, but it would be a simple solution.

Reply With Quote
  #20 (permalink)
 runit 
Toronto, Ontario/Canada
 
Experience: Intermediate
Platform: TOS
Trading: stocks
Posts: 38 since Dec 2014
Thanks Given: 10
Thanks Received: 3



pstrusi View Post
Stop Profit/Loss orders would accomplish your goal, unless, for some reason, you don't want to have working stops orders, but it would be a simple solution.

That would work if I had one underlying open at the same time.

If I have more than one, I want the NET unrealized P/l to be a certain number, and then flatten all of my positions. If say, it's $100, that could mean one position is +200 and one is -100 - net unrealized p/l +100, and i need to close them all at the same time.

Started this thread Reply With Quote




Last Updated on December 3, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts