Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Updated November 20, 2012
Top Posters
looks_one
maxi
with 8 posts (0 thanks)
looks_two
MWinfrey
with 7 posts (1 thanks)
looks_3
vvhg
with 6 posts (3 thanks)
looks_4
terratec
with 5 posts (1 thanks)
trending_up
11,364 views
thumb_up
5 thanks given
group
6 followers
forum
26 posts
attach_file
0 attachments
July 6th, 2012, 04:30 PM
Zurich Switzerland
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515
I never had a problem with partial fill. So I did not code it
Maybe you could try something with a.Position.Count
(But.... a.Positions.Count is difficult because it is not instrument but account specific!! So this alone is not enough.)
Or compare a variable with position before and after execution and order size.
But i don't know. That is a reason for my switch to strategies, as all that stuff is very easy there and does not take hours to find out.
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
July 6th, 2012, 07:13 PM
Rome, Italy
Posts: 17 since Jul 2010
Thanks Given: 2
Thanks Received: 1
Yes, I agree with you.
Strategies are easier for managing orders (I've coded several..) but my project at the moment is addressed to discretionary trading, so I'd need ChartTrader and something that could be tailored on it (different from ATM of course..!).
Thanks.
Nice we.
July 7th, 2012, 02:49 AM
Zurich Switzerland
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515
maxi
...but my project at the moment is addressed to discretionary trading, so I'd need ChartTrader and something that could be tailored on it
I am trading discretionary. At the end of the day it was easier for me to create the missing parts of a strategy chart, like ChartTrader tools, plot visualization of positions, stops, targets etc. than doing the trade and account stuff in indicators. By the way, a combination of indicator/strategy is a solution too, that I often use.
Have a nice WE too. I will be soon in Italy (Tuscany) for some days with my bici.
July 7th, 2012, 12:51 PM
Rome, Italy
Posts: 17 since Jul 2010
Thanks Given: 2
Thanks Received: 1
Well, is quite warm in Italy at mom.
Enjoy your bike tour
November 19th, 2012, 10:40 AM
Lubbock TX
Experience: Intermediate
Platform: NinjaTrader
Broker: Stage 5 Trading
Trading: CL
Posts: 1,878 since Jul 2009
Thanks Given: 1,450
Thanks Received: 3,335
Curious if anyone has been successful retrieving the cash value of an account. I am using Account.GetAccountValue(AccountItem.CashValue,Currency.UsDollar). I can get the name of the account but nothing else.
November 19th, 2012, 11:18 AM
Northern Germany
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,580 since Mar 2011
Thanks Given: 1,016
Thanks Received: 2,824
MWinfrey
Curious if anyone has been successful retrieving the cash value of an account. I am using Account.GetAccountValue(AccountItem.CashValue,Currency.UsDollar). I can get the name of the account but nothing else.
I think you have to get the Account object first like this:
Code
NinjaTrader.Cbi.Globals.Accounts[0].GetAccountValue(AccountItem.CashValue, Currency.UsDollar);
This post might be helpful in finding the right account:
maxi
terratec, need more help please.
I need to insert an order and, if filled, a stop and target orders must be placed on the market.
I tried with you suggestion this way:
Code
#region Variables
Order b = null;
#endregion
protected override void OnStartUp()
{
string accName = ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Controls["cboAccount"].Text;
accnt = null;
for (int i = 0;i <= NinjaTrader.Cbi.Globals.Accounts.Count - 1; i++)
{
if (NinjaTrader.Cbi.Globals.Accounts[i].Name == accName)
{
accnt = NinjaTrader.Cbi.Globals.Accounts[i];
}
}
// I created a button where I linked the following to enter a buy stop order:
#region Entry
private void btnOrdSend_Click(object s, EventArgs e)
{
int quantity = 1;
if (quantity < 1 || entryprice <=1) return;
if (accnt != null)
{
b = accnt.CreateOrder(Instrument,OrderAction.Buy,OrderType.Stop,TimeInForce.Day,quantity,0,entryprice,"","Buy");
b.Submit();
}
}
#endregion
// I'm trying to see if the order is filled with the following on OnBarUpdate
protected override void OnBarUpdate()
{
if (b.OrderState == OrderState.Filled)
{
MessageBox.Show("Filled");
}
}
The button perfectly insert the buy
stop order on the market but, once filled, no message is shown.
I'm a bit confused on the way the stop/target orders should be coded.
Probably they shouldn't be inserted in the OnBarUpdate space?
I've seen the use of the override Plot, but I've never used it so I don't know how to manage it.
Thanks for any hint
vvhg
November 19th, 2012, 11:20 AM
Lubbock TX
Experience: Intermediate
Platform: NinjaTrader
Broker: Stage 5 Trading
Trading: CL
Posts: 1,878 since Jul 2009
Thanks Given: 1,450
Thanks Received: 3,335
vvhg
I think you have to get the Account object first like this:
Code
NinjaTrader.Cbi.Globals.Accounts[0].GetAccountValue(AccountItem.CashValue, Currency.UsDollar);
This post might be helpful in finding the right account:
vvhg
Thanks...I didn't include that in my first post but that's exactly what I'm doing.
November 19th, 2012, 11:31 AM
Northern Germany
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,580 since Mar 2011
Thanks Given: 1,016
Thanks Received: 2,824
MWinfrey
Thanks...I didn't include that in my first post but that's exactly what I'm doing.
Do you get any errors?
Did you check for null?
And have you tried:
Code
NinjaTrader.Cbi.Globals.Accounts[0 or whatever acct you want].GetAccountValue(AccountItem.CashValue, Currency.UsDollar).Value
vvhg
November 19th, 2012, 11:38 AM
Lubbock TX
Experience: Intermediate
Platform: NinjaTrader
Broker: Stage 5 Trading
Trading: CL
Posts: 1,878 since Jul 2009
Thanks Given: 1,450
Thanks Received: 3,335
vvhg
Do you get any errors?
Did you check for null?
And have you tried:
Code
NinjaTrader.Cbi.Globals.Accounts[0 or whatever acct you want].GetAccountValue(AccountItem.CashValue, Currency.UsDollar).Value
vvhg
no error in the log or output window. just added .Value and no change. following is my code...
Code
for (int i = 0;i <= NinjaTrader.Cbi.Globals.Accounts.Count - 1; i++)
{
if (NinjaTrader.Cbi.Globals.Accounts[i].Name == Account.Name)
{
accnt = NinjaTrader.Cbi.Globals.Accounts[i];
Print(accnt.Name + " " + accnt.GetAccountValue(AccountItem.CashValue,Currency.UsDollar).Value);
}
}
the output is
RisingFallingCL 0
So as you can see the cash value reports as zero.
November 19th, 2012, 12:09 PM
Northern Germany
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,580 since Mar 2011
Thanks Given: 1,016
Thanks Received: 2,824
MWinfrey
no error in the log or output window. just added .Value and no change. following is my code...
Code
for (int i = 0;i <= NinjaTrader.Cbi.Globals.Accounts.Count - 1; i++)
{
if (NinjaTrader.Cbi.Globals.Accounts[i].Name == Account.Name)
{
accnt = NinjaTrader.Cbi.Globals.Accounts[i];
Print(accnt.Name + " " + accnt.GetAccountValue(AccountItem.CashValue,Currency.UsDollar).Value);
}
}
the output is
RisingFallingCL 0
So as you can see the cash value reports as zero.
Yes, I get the exact same behavior, on all items...
vvhg
Last Updated on November 20, 2012