Trading Articles
Article Categories
Article Tools
Strategy code assist needed for handling positions
Updated November 13, 2012
Top Posters
looks_one
sburtt
with 6 posts (0 thanks)
looks_two
baruchs
with 1 posts (0 thanks)
looks_3
Quick Summary
with 1 posts (0 thanks)
looks_4
MWinfrey
with 1 posts (0 thanks)
trending_up
1,936 views
thumb_up
0 thanks given
group
3 followers
forum
10 posts
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)
Strategy code assist needed for handling positions
(login for full post details)
#1 (permalink )
London, UK
Experience: Advanced
Platform: NinjaTrader
Trading: EUR/USD
Posts: 58 since Jul 2012
Thanks: 3 given,
4
received
Hi Guys,
I am new to NT, I am sure this is likely easy ... just cant yet get my head around it.
If my market position is long and my strategy generates a short signal, how can tell NT to go short twice the default size, and even more important how can I explain NT that at this point my net short position is 1 time the default size, hence stop loss should apply to that size and not the 2 * default size?
Please let me know if my query is clear, thanks for your help
John
Can you help answer these questions from other members on futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#3 (permalink )
Lubbock TX
Experience: Intermediate
Platform: NinjaTrader
Broker: Stage 5 Trading
Trading: CL
Posts: 1,880 since Jul 2009
Thanks: 1,450 given,
3,325
received
sburtt
Hi Guys,
I am new to NT, I am sure this is likely easy ... just cant yet get my head around it.
If my market position is long and my strategy generates a short signal, how can tell NT to go short twice the default size, and even more important how can I explain NT that at this point my net short position is 1 time the default size, hence stop loss should apply to that size and not the 2 * default size?
Please let me know if my query is clear, thanks for your help
John
If I understand your situation correctly that's just a stop and reverse . You don't have to keep track of the number of contracts .
go to this link and look at the sample code in the attachment Strategy: Trading crossovers - NinjaTrader Support Forum
That should get you started.
(login for full post details)
#4 (permalink )
London, UK
Experience: Advanced
Platform: NinjaTrader
Trading: EUR/USD
Posts: 58 since Jul 2012
Thanks: 3 given,
4
received
MWinfrey
not really. What I mean is assume I am long 50k EURUSD, when I get a short signal what NT does is cover 50k EURUSD long and short 50k EURUSD, basically it sells 100k EURUSD, but instead of doing this with 1 trade it does 2 trades, hence I pay twice commissions.
IF I set my short order to:
EnterShort(DefaultQuantity*2,"");
I avoid this problem, HOWEVER, at this point it doesn't accept/identify the correct quantity to buy on my StopLoss, what NT does is set the StopLoss quantity to 100k, rather than my current position of 50k.
My question is what should I use in the Quatity field of my order:
ExitShort();
?
Thanks,
(login for full post details)
#5 (permalink )
Bala, PA, USA
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,858 since Jul 2010
Thanks: 300 given,
3,338
received
sburtt
not really. What I mean is assume I am long 50k EURUSD, when I get a short signal what NT does is
cover 50k EURUSD long and short 50k EURUSD, basically it sells 100k EURUSD, but instead of doing this with 1 trade it does 2 trades, hence I pay twice commissions.
IF I set my short order to:
EnterShort(DefaultQuantity*2,"");
I avoid this problem, HOWEVER, at this point it doesn't accept/identify the correct quantity to buy on my StopLoss, what NT does is set the StopLoss quantity to 100k, rather than my current position of 50k.
My question is what should I use in the Quatity field of my order:
ExitShort();
?
Thanks,
Use 'Unmanaged' orders. But, that does require some additional (advanced) coding.
(login for full post details)
#6 (permalink )
London, UK
Experience: Advanced
Platform: NinjaTrader
Trading: EUR/USD
Posts: 58 since Jul 2012
Thanks: 3 given,
4
received
Here is attached an example of what I mean
(login for full post details)
#7 (permalink )
London, UK
Experience: Advanced
Platform: NinjaTrader
Trading: EUR/USD
Posts: 58 since Jul 2012
Thanks: 3 given,
4
received
are you sure there is no way to sort this issue out under the managed order protocol?
(login for full post details)
#8 (permalink )
Toledo, OH
Posts: 41 since Nov 2012
Thanks: 16 given,
46
received
Hi,
You have to go the route of unmanaged orders to circumvent the Ninja failsafe of having two trades in two directions simultaneously. One question I always ask, is saving on the commission that important that you want to open yourself to the world of unmanaged orders?
Again, it can be done but not recommended. Time better spent on extending profitability of current methods than squeezing money out of the commissions bucket, IMHO.
(login for full post details)
#9 (permalink )
Israel
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
Posts: 323 since Jun 2009
Thanks: 6 given,
207
received
Quoting
What I mean is assume I am long 50k EURUSD, when I get a short signal what NT does is
cover 50k EURUSD long and short 50k EURUSD, basically it sells 100k EURUSD, but instead of doing this with 1 trade it does 2 trades, hence I pay twice commissions.
You pay commition for 100K! It doesn't metter if you make 1,2 or 100 trades.
(login for full post details)
#10 (permalink )
London, UK
Experience: Advanced
Platform: NinjaTrader
Trading: EUR/USD
Posts: 58 since Jul 2012
Thanks: 3 given,
4
received
baruchs
You pay commition for 100K! It doesn't metter if you make 1,2 or 100 trades.
Not true if you have a fixed commission up to 100k
(login for full post details)
#11 (permalink )
London, UK
Experience: Advanced
Platform: NinjaTrader
Trading: EUR/USD
Posts: 58 since Jul 2012
Thanks: 3 given,
4
received
FalseProphets
Hi,
You have to go the route of unmanaged orders to circumvent the Ninja failsafe of having two trades in two directions simultaneously. One question I always ask, is saving on the commission that important that you want to open yourself to the world of unmanaged orders?
Again, it can be done but not recommended. Time better spent on extending profitability of current methods than squeezing money out of the commissions bucket, IMHO.
Not totally true, considering i am talking about a 5 min strategy with approx 6 entries per day
Last Updated on November 13, 2012
Right now
Ongoing
Right now
March
Register to Attend
Elite only
Coming soon
April