Go Back   NinjaTrader Support Forum > NinjaTrader 7 > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 02-08-2018, 11:16 AM   #1
franki
Junior Member
 
Join Date: Jan 2016
Posts: 10
Thanks: 3
Thanked 1 time in 1 post
Default ghost profit?

I do not know if it is the right place for this post.
I'm doing demo tests for a bot, running in real time.
Sometimes it happens that it reaches the profit long before the price arrives.
I use the bot with the NTRenko10 filter.
Does anyone know if the bug is the fault of the programming of the bot or the data (DEMO) of CQG?
I attach images.
YM target.jpg

NQ target.jpg

very thanks
franki is offline  
Reply With Quote
Old 02-08-2018, 11:33 AM   #2
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 8,044
Thanks: 122
Thanked 1,784 times in 1,673 posts
Default

Hello franki,

Sometimes is good to check a 1 tick ask or 1 tick bid chart at that time to see if there was a tick received at that price.

The order if placed after real-time data is proceeded would be filling the orders using the real-time ask and bid prices.

I would also check that the PC clock is in sync with internet time.

Compare your PC Clock with https://www.time.gov/
If you are not in sync:
  • Shutdown NinjaTrader
  • Right-click the clock in the lower right corner of your desktop -> Select Adjust date/time
  • If you are using Windows 10, click 'Additional date, time, & regional settings' -> then click 'Set the time and date'
  • Click on Internet Time tab
  • In the Server: drop-down select time.nist.gov
  • Click Update
  • If the message that appears says successful your PC clock should now be updated
  • If not, select a different server from the Server: drop-down and try again (repeat until one of the servers is successful)
  • Restart NinjaTrader
  • Connect to a data feed, then right-click the chart and select Reload All Historical Data

http://mintywhite.com/windows-7/7mai...t-time-how-to/
http://www.windows10update.com/2015/...t-time-server/
NinjaTrader_ChelseaB is offline  
Reply With Quote
Old 02-08-2018, 01:12 PM   #3
franki
Junior Member
 
Join Date: Jan 2016
Posts: 10
Thanks: 3
Thanked 1 time in 1 post
Default

Hi!! ChelseaB, very thanks for your help

Quote:
Originally Posted by NinjaTrader_ChelseaB View Post
Hello franki,

Sometimes is good to check a 1 tick ask or 1 tick bid chart at that time to see if there was a tick received at that price.

The order if placed after real-time data is proceeded would be filling the orders using the real-time ask and bid prices.
Graphs of ticks in real account or in real time?
data feeds is the same in demo account and real account?
attached tick images

Quote:
Originally Posted by NinjaTrader_ChelseaB View Post
I would also check that the PC clock is in sync with internet time.

Compare your PC Clock with https://www.time.gov/
If you are not in sync:
  • Shutdown NinjaTrader
  • Right-click the clock in the lower right corner of your desktop -> Select Adjust date/time
  • If you are using Windows 10, click 'Additional date, time, & regional settings' -> then click 'Set the time and date'
  • Click on Internet Time tab
  • In the Server: drop-down select time.nist.gov
  • Click Update
  • If the message that appears says successful your PC clock should now be updated
  • If not, select a different server from the Server: drop-down and try again (repeat until one of the servers is successful)
  • Restart NinjaTrader
  • Connect to a data feed, then right-click the chart and select Reload All Historical Data

http://mintywhite.com/windows-7/7mai...t-time-how-to/
http://www.windows10update.com/2015/...t-time-server/
my computer has always been well synchronized.
Central European Time GMT + 1

This bug is today when I've seen it in 2 instruments. But it may have happened many more times.
I need to debug this error, to pass the strategy to the VPS test and later to a real account.
Thx!
Attached Images
File Type: jpg 1tick bid.jpg (200.6 KB, 10 views)
File Type: jpg 25Tick timeframe.jpg (146.6 KB, 8 views)
File Type: jpg 1tick ask.jpg (151.9 KB, 7 views)
franki is offline  
Reply With Quote
Old 02-08-2018, 01:34 PM   #4
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 8,044
Thanks: 122
Thanked 1,784 times in 1,673 posts
Default

Hi franki,

We should still be able to see the execution marker on the ask chart.

The order is a buy order to close a short position, is this correct?

Buy orders fill at the ask. Where is this order on the ask chart?
NinjaTrader_ChelseaB is offline  
Reply With Quote
The following user says thank you to NinjaTrader_ChelseaB for this post:
Old 02-08-2018, 07:28 PM   #5
franki
Junior Member
 
Join Date: Jan 2016
Posts: 10
Thanks: 3
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by NinjaTrader_ChelseaB View Post
Hi franki,

We should still be able to see the execution marker on the ask chart.

The order is a buy order to close a short position, is this correct?
Yes, the target it's buy order 75 ticks in short possition, but the short make 133 ticks

Quote:
Originally Posted by NinjaTrader_ChelseaB View Post

Buy orders fill at the ask. Where is this order on the ask chart?
I add new images and log

Enter Trade!
Code:
08/02/2018 15:28:05|1|32|Order='0f8ff1fb2e8c47f589f2bd6eedf68b0d/Sim101' Name='Sell short' New state=PendingSubmit Instrument='YM 03-18' Action=SellShort Limit price=24846 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
08/02/2018 15:28:05|1|32|Order='0f8ff1fb2e8c47f589f2bd6eedf68b0d/Sim101' Name='Sell short' New state=Accepted Instrument='YM 03-18' Action=SellShort Limit price=24846 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
08/02/2018 15:28:05|1|32|Order='0f8ff1fb2e8c47f589f2bd6eedf68b0d/Sim101' Name='Sell short' New state=Working Instrument='YM 03-18' Action=SellShort Limit price=24846 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
08/02/2018 15:28:06|1|32|Order='0f8ff1fb2e8c47f589f2bd6eedf68b0d/Sim101' Name='Sell short' New state=Filled Instrument='YM 03-18' Action=SellShort Limit price=24846 Stop price=0 Quantity=1 Type=Limit Filled=1 Fill price=24846 Error=NoError Native error=''
08/02/2018 15:28:06|1|16|Execution='82ab77f99f3648c3b4686118cef1b5b3' Instrument='YM 03-18' Account='Sim101' Exchange=Default Price=24846 Quantity=1 Market position=Short Operation=Insert Order='0f8ff1fb2e8c47f589f2bd6eedf68b0d' Time='08/02/2018 15:28:06'
08/02/2018 15:28:06|1|64|Instrument='YM 03-18' Account='Sim101' Avg price=24846 Quantity=1 Market position=Short Operation=Insert Currency=Unknown
08/02/2018 15:28:06|1|32|Order='966558939e554d36a7c1eb59d0dd7e6e/Sim101' Name='Stop loss' New state=PendingSubmit Instrument='YM 03-18' Action=BuyToCover Limit price=0 Stop price=24876 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
08/02/2018 15:28:06|1|32|Order='5a6988e3cd7c48e29b1b19fc345a412c/Sim101' Name='Profit target' New state=PendingSubmit Instrument='YM 03-18' Action=BuyToCover Limit price=24771 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
08/02/2018 15:28:06|1|32|Order='966558939e554d36a7c1eb59d0dd7e6e/Sim101' Name='Stop loss' New state=Accepted Instrument='YM 03-18' Action=BuyToCover Limit price=0 Stop price=24876 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
08/02/2018 15:28:06|1|32|Order='5a6988e3cd7c48e29b1b19fc345a412c/Sim101' Name='Profit target' New state=Accepted Instrument='YM 03-18' Action=BuyToCover Limit price=24771 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
08/02/2018 15:28:06|1|32|Order='5a6988e3cd7c48e29b1b19fc345a412c/Sim101' Name='Profit target' New state=Working Instrument='YM 03-18' Action=BuyToCover Limit price=24771 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
Exit Trade!
Code:
08/02/2018 15:30:02|1|32|Order='5a6988e3cd7c48e29b1b19fc345a412c/Sim101' Name='Profit target' New state=Filled Instrument='YM 03-18' Action=BuyToCover Limit price=24771 Stop price=0 Quantity=1 Type=Limit Filled=1 Fill price=24734 Error=NoError Native error=''
08/02/2018 15:30:02|1|32|Order='966558939e554d36a7c1eb59d0dd7e6e/Sim101' Name='Stop loss' New state=PendingCancel Instrument='YM 03-18' Action=BuyToCover Limit price=0 Stop price=24876 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
08/02/2018 15:30:02|1|16|Execution='75cb00f76a3246209b6f26bab5e845ca' Instrument='YM 03-18' Account='Sim101' Exchange=Default Price=24734 Quantity=1 Market position=Long Operation=Insert Order='5a6988e3cd7c48e29b1b19fc345a412c' Time='08/02/2018 15:30:02'
08/02/2018 15:30:02|1|64|Instrument='YM 03-18' Account='Sim101' Avg price=24734 Quantity=0 Market position=Short Operation=Remove Currency=Unknown
08/02/2018 15:30:03|1|32|Order='966558939e554d36a7c1eb59d0dd7e6e/Sim101' Name='Stop loss' New state=Cancelled Instrument='YM 03-18' Action=BuyToCover Limit price=0 Stop price=24876 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
Although the error favors the trade, it distorts the real result.
With the NQ instrument, it also happens the same and so I think it's not an isolated situation and this bug will be repeated
Thx!!
Attached Images
File Type: jpg YM Bid-Ask.jpg (420.5 KB, 6 views)
File Type: jpg Lag.jpg (206.6 KB, 4 views)
franki is offline  
Reply With Quote
Old 02-09-2018, 10:17 AM   #6
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,134
Thanks: 770
Thanked 1,917 times in 1,846 posts
Default

Hello franki,

Thank you for your response.

Is this the first occurrence you have seen of this on the Sim101 account for real-time executions?

I would recommend repairing the database at this point but this would not correct any previous executions at the incorrect price level.

What version of NinjaTrader 7 are you using? You can check this by going to Help > About in the Control Center.

I look forward to your response.
Last edited by NinjaTrader_PatrickH; 02-09-2018 at 03:51 PM.
NinjaTrader_PatrickH is offline  
Reply With Quote
Old 02-09-2018, 02:19 PM   #7
franki
Junior Member
 
Join Date: Jan 2016
Posts: 10
Thanks: 3
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by NinjaTrader_PatrickH View Post
Hello franki,

Thank you for your response.

Is this the first occurrence your have seen of this on the Sim101 account for real-time executions?

I would recommend repairing the database at this point but this would not correct any previous executions at the incorrect price level.

What version of NinjaTrader 7 are you using? You can check this by going to Help > About in the Control Center.

I look forward to your response.
Hello PatrickH
Version NinjaTrader 64-bit 7.0.1000.37

my system was formatted and installed all over again two months ago

Thank you PatrickH
franki is offline  
Reply With Quote
Old 02-09-2018, 03:52 PM   #8
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,134
Thanks: 770
Thanked 1,917 times in 1,846 posts
Default

Hello franki,

Thank you for your response.

Have you seen this behavior occur previously? Have you seen it occur before or after your reinstalled two months ago?

I look forward to your response.
NinjaTrader_PatrickH is offline  
Reply With Quote
The following user says thank you to NinjaTrader_PatrickH for this post:
Old 02-09-2018, 06:28 PM   #9
franki
Junior Member
 
Join Date: Jan 2016
Posts: 10
Thanks: 3
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by NinjaTrader_PatrickH View Post
Hello franki,

Thank you for your response.

Have you seen this behavior occur previously? Have you seen it occur before or after your reinstalled two months ago?

I look forward to your response.
Hello PatrickH

I remember seeing that behavior before the reinstallation, but I did not give importance because the bot was not yet ready for the live market
Now I use another bot and I can discard relation with the previous bot and platform ninjatrader.
Before I used unirenko bars and now I use 10NTRenko bars
2 months ago I lived in another city and used another internet connection.
During today I have not appreciated any errors
Thank you PatrickH
franki is offline  
Reply With Quote
Old 02-10-2018, 12:34 AM   #10
bltdavid
Senior Member
 
Join Date: Dec 2013
Location: Silicon Valley, California
Posts: 626
Thanks: 26
Thanked 213 times in 180 posts
Default

In your first post, you said "NTRenko10", and just now you said "10NTRenko".

Could you explain more? What exactly is the bartype you're using?

Are you trying to say your chart is using the standard NinjaTrader "Renko" bar with a BrickSize set to 10?

Backtesting a strategy with standard Renko bars does not give valid results.
bltdavid is offline  
Reply With Quote
Old 02-12-2018, 07:08 AM   #11
franki
Junior Member
 
Join Date: Jan 2016
Posts: 10
Thanks: 3
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by bltdavid View Post
In your first post, you said "NTRenko10", and just now you said "10NTRenko".
You can see the images of my first post.

Quote:
Originally Posted by bltdavid View Post
Could you explain more? What exactly is the bartype you're using?
I always refer to NTRenkocandele (being strict and exactly) value 10
Quote:
Originally Posted by bltdavid View Post

Are you trying to say your chart is using the standard NinjaTrader "Renko" bar with a BrickSize set to 10?
no, i'm never using stardar renko bars

Quote:
Originally Posted by bltdavid View Post
Backtesting a strategy with standard Renko bars does not give valid results.
The backtesting of the strategy is done in real time and is not done with "strategy analyzer"
You can check a high percentage of success, except when ghost targets occur
Have you seen this type of targets before?

thx bltdavid
franki is offline  
Reply With Quote
Old 02-12-2018, 10:18 AM   #12
franki
Junior Member
 
Join Date: Jan 2016
Posts: 10
Thanks: 3
Thanked 1 time in 1 post
Default

It is not an isolated incident
It continues to happen frequently

Today...
Attached Images
File Type: jpg Faketarget.jpg (318.6 KB, 5 views)
franki is offline  
Reply With Quote
Old 02-12-2018, 11:55 AM   #13
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,134
Thanks: 770
Thanked 1,917 times in 1,846 posts
Default

Hello franki,

Thank you for your response.

As a test please try a new database by renaming your current database. You can rename your database by following the steps below.
  • Shutdown NinjaTrader and Go to the Start Menu
  • Select My Documents--> NinjaTrader 7--> DB--> NinjaTrader.SDF.
  • Right click on NinjaTrader.SDF and select "Rename." *Name it "OLDNinjaTrader.SDF."
  • Then restart the software and NinjaTrader will create a fresh database file to use
Please let me know if the behavior continues on the Sim101 account when trying a new database.
NinjaTrader_PatrickH is offline  
Reply With Quote
Old 02-16-2018, 01:42 PM   #14
franki
Junior Member
 
Join Date: Jan 2016
Posts: 10
Thanks: 3
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by NinjaTrader_PatrickH View Post
Hello franki,

Thank you for your response.

As a test please try a new database by renaming your current database. You can rename your database by following the steps below.
  • Shutdown NinjaTrader and Go to the Start Menu
  • Select My Documents--> NinjaTrader 7--> DB--> NinjaTrader.SDF.
  • Right click on NinjaTrader.SDF and select "Rename." *Name it "OLDNinjaTrader.SDF."
  • Then restart the software and NinjaTrader will create a fresh database file to use
Please let me know if the behavior continues on the Sim101 account when trying a new database.
Hello PatrickH

After having followed your advice
the same error continues to appear in the target
Thx
Attached Images
File Type: jpg ghost1.jpg (148.3 KB, 2 views)
franki is offline  
Reply With Quote
Old 02-16-2018, 02:05 PM   #15
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,134
Thanks: 770
Thanked 1,917 times in 1,846 posts
Default

Hello franki,

Thank you for your update.

So the strategy is running on the custom bar type in these instances, correct? Do you continue to see the issue if the strategy runs on the Renko bars type or something simple like a 1 Minute bars type?

I look forward to your response.
NinjaTrader_PatrickH is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ghost Executions cnecorp Strategy Development 4 10-22-2015 05:33 PM
Ghost Entries tonynt Platform Technical Support 1 06-16-2015 06:36 AM
Ghost position guillembm Platform Technical Support 3 09-15-2011 06:52 AM
Ghost Trade hothomas Platform Technical Support 1 08-14-2011 06:57 PM
Ghost Indicator neb1998 Indicator Development 1 05-22-2011 07:56 PM


All times are GMT -6. The time now is 05:55 PM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.