Need help with this situation - futures io
futures io futures trading



Need help with this situation


Discussion in NinjaTrader

Updated
    1. trending_up 1,040 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Need help with this situation

(login for full post details)
  #1 (permalink)
Legendary Market Wizard
Salt Lake City, UT
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL, ES, NQ, YM
 
richw's Avatar
 
Posts: 1,264 since May 2010
Thanks: 975 given, 845 received

I have order 1 (entryOrderLong1) and order 2 (entryOrderLong2) in one strategy. Each one seems to need its own profit target and stop. Unless I am doing something wrong, this seems to result in Position.AvgPrice just returning the average price for entryOrderLong1 and a different average price for entryOrderLong2. So when I try to set the profit targets, I can set them each correctly based on its own price average, but it is not correct for the entire strategy.

Example, entryOrderLong1 is filled for 2 contracts at 90.85 and entryOrderLong2 gets filled for 4 contracts at 90.75. 90.85 is the Position.AvgPrice for entryOrderLong1 and 90.75 is the Position.AvgPrice for entryOrderLong2. The real average for the 6 contracts is 90.78. I want my profit target to be 10 ticks above 90.78 for all contracts. Now, if the strategy averages down again at 90.65 for 4 more contracts, the Position.AvgPrice for entryOrderLong3 is 90.65, but now my price average for all open contracts is 90.73. I would now want my profit target for all open contracts in the 3 orders to be 90.83 (10 ticks above 90.73).

How would I handle this? If there some kind of variable like Position.AvgPrice that applies to all open contracts, then it should be fairly simple.

Is there one Position.AvgPrice that applies to all open contracts in the strategy?

NinjaTrader is aware of this value which means it exists somewhere, but I can't locate it. See attached image.

Attached Thumbnails
Click image for larger version

Name:	entire-position-avg-price-ex1.png
Views:	72
Size:	35.2 KB
ID:	31733  
Visit my futures io Trade Journal Started this thread Reply With Quote

Journal Challenge February 2021 results:
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(173 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(35 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
OC, California, USA
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,958 since Jun 2009
Thanks: 528 given, 3,648 received


Can you post your strategy code so we can examine and modify it?

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #4 (permalink)
Legendary Market Wizard
Salt Lake City, UT
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL, ES, NQ, YM
 
richw's Avatar
 
Posts: 1,264 since May 2010
Thanks: 975 given, 845 received

Thanks for responding. I realized in doing some more investigation that it isn't the average price I am having trouble with and need solving. The real issue is how to modify the target orders later so that they continue to be 10 ticks away from the position average as more contracts are purchased and the position average changes. Since it is based on some code I found in the Elite section, I would have to post the code somewhere over there. Actually, the code is pretty much this:



I have just made very slight changes for entry signal and entry price, but those changes have not affected the structure of the code. So apparently, what I am ending up with currently is multiple profit target orders each placed x number of ticks from the Position.AvgPrice at the time the order was filled.

Can you provide an example of how to move my target orders to be x number of ticks away from Position.AvgPrice as it changes?

Visit my futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
Legendary Market Wizard
Salt Lake City, UT
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL, ES, NQ, YM
 
richw's Avatar
 
Posts: 1,264 since May 2010
Thanks: 975 given, 845 received

I removed the parts that would make it both a long and short strategy. I am just focused on making a strategy for a long position at this time.

Visit my futures io Trade Journal Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Need help with this situation


Last Updated on February 24, 2011


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

New Challenge (TBD)

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts