Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
realtime strategy automation disabled?
Collapse
X
-
Hello IceRage,
Automated strategy functionality has not been disabled in the latest version.
Can you please check if you selected the correct account.
Could it be the strategy conditions to submit orders have not been met yet?
Do you receive any error messages in the Log-tab?JasonNinjaTrader Customer Service
-
Calculated target price for strategy 'strategy name' was smaller/equal 0. No target
I am getting the same error message in automation at Interactive Brokers. It works in the simulated account.
I am trading Soybeans and when the strategy goes short, it exits immediately and gives the error message,
"Calculated target price for strategy 'strategy name' was smaller/equal 0. No target order placed"
This is for November Soybeans and the profit target is $950. It is a day trade strategy and the code for the profit target is:
SetProfitTarget(ProfitTargetAmt*Contracts);
Here is the code
protected override void OnBar Update()
{
if (BarsInProgress == 0) return;
***Long and Short Entry Code here*****
SetProfitTarget(ProfitAmt*Contracts);
SetStopLoss(StopLossAmt*Contracts);
}
What could be the problem?
Comment
-
It starts out as a private int for user input:
private int pProfitTargetAmt = 950;
then i do the following:
public int ProfitTargetAmt
{
get {return pProfitTargetAmt;}
set {pProfitTargetAmt = Math.Max(1,value);}
}
It works in Sim mode and backtesting but I haven't done the Print statement yet. If it works in Sim mode and backtesting, would the Print statement reveal something new?
Comment
-
Hello,
It would be good to know what the value is when you're trading live. There shouldn't be a difference, however we shouldn't overlook this as that could explain the error you are receiving.
Is it on the targets you receive errors on? Does the entry order submit? Does the stop loss work as expected?MatthewNinjaTrader Product Management
Comment
-
The Sim account and historical backtesting work with entries and exits. The entries work as expected on the Live account but so far with only 2 live trades in this scenario on Interactive Broker account, the strategy exits as soon as it is open with the given error (show below) so we haven't had a chance to test stops or profit targets live.
The main problem is having to test with a live account and real money (since the Sim account works fine). Are there reasons a live account would differ from a simulated account?
What would the print statement look like for the profit target and stop loss?
Comment
-
Hello,
The print statement should return with the value the target should be submitted to.
In order for me to help determine why this is occurring, I will need to review your log and trace files from the last date that this occurred.
Please send an email to support[at]ninjatrader[dot]com and include your most recent log and trace files, Attn: Matthew in the Subject line and a reference to this thread.
You will find the log file in the Documents > NinjaTrader 7 > Log folder.
- The log file will be named log.20110930.txt
You will find the trace file in the Documents > NinjaTrader 7 > Trace folder.
- The trace file will be named trace.20110930.txt
Please attach both of these files to your next response. If these files are over 4MB, please let me know and I can respond with alternative instructions.MatthewNinjaTrader Product Management
Comment
-
Found this thread by google:
The error "Calculated target price for strategy ... was smaller/equal 0" may also be result of the following [red-eye programming]:
Open position using EnterLong and reversing it with EnterShortLimit(Quantity, signalName) instead of EnterShort(Quantity, signalName)
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by johnMoss, 03-04-2024, 01:53 PM
|
3 responses
46 views
0 likes
|
Last Post
by AndyM
Today, 06:13 PM
|
||
Started by algospoke, Today, 06:01 PM
|
0 responses
8 views
0 likes
|
Last Post
by algospoke
Today, 06:01 PM
|
||
Started by cre8able, Today, 05:53 PM
|
0 responses
8 views
0 likes
|
Last Post
by cre8able
Today, 05:53 PM
|
||
Started by Wessel, 03-23-2024, 02:37 PM
|
3 responses
24 views
0 likes
|
Last Post Today, 04:58 PM | ||
Started by martini, Yesterday, 04:45 PM
|
4 responses
32 views
0 likes
|
Last Post
by martini
Today, 04:48 PM
|
Comment