NexusFi: Find Your Edge


Home Menu

 





Validate symbol/instrument before using it in NinjaTrader


Discussion in NinjaTrader

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




 
Search this Thread

Validate symbol/instrument before using it in NinjaTrader

  #1 (permalink)
 
AlBundy's Avatar
 AlBundy 
Vienna Austria
 
Experience: Advanced
Platform: NinjaTrader
Trading: Forex
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 12

Hi,

is there a function which checks if a symbol is valid? I need it for this situation:
For my strategy the symbols are stored in a text file. While the initialization I call for each symbol in the text file the Add() function.
When the symbol is not correct [for example $GPBUSD – a classic mistyping] then nothing happens except of a message in the log section of NT Control Center..
A “normal” user does not check the Log section and therefore it would be very nice if the program can check in advance if the symbol is valid and shows another message to inform the user.
Otherwise the user really does not know what is going on…

How can I achieve this?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
About a successful futures trader who didnt know anythin …
Psychology and Money Management
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #2 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


AlBundy View Post
Hi,

iIs there a function which checks if a symbol is valid? I need it for this situation:
For my strategy the symbols are stored in a text file. While the initialization I call for each symbol in the text file the Add() function.
When the symbol is not correct [for example $GPBUSD – a classic mistyping] then nothing happens except of a message in the log section of NT Control Center..
A “normal” user does not check the Log section and therefore it would be very nice if the program can check in advance if the symbol is valid and shows another message to inform the user.
Otherwise the user really does not know what is going on…

How can I achieve this?

How many symbols have you stored in your text file?

Don't you think that it is easier to check the log section than code a program that does the same thing as the logs?

Reply With Quote
  #3 (permalink)
 
AlBundy's Avatar
 AlBundy 
Vienna Austria
 
Experience: Advanced
Platform: NinjaTrader
Trading: Forex
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 12



Quoting 
How many symbols have you stored in your text file?

This depends on the user who is working with the indicator. It can be between 1 and 30


Quoting 
Don't you think that it is easier to check the log section than code a program that does the same thing as the logs?

Short version: No
Long Version:
  1. As programmer I have the Log section open. But I am used to write software which informs the user in a proper way without bothering him with some logs.
  2. It is definitely easier to write this few lines of code to make it more comfortable.
  3. The indicator is supposed to run "unattended" and therefore an email should be sent. In this case for example the futures expire and with this functionality I can send an email to inform the user the symbol list must be updated OR I can update/correct the future symbol automatically when I know it is not correct when it was the last time correct. This is simpler than write an algorithm which considers the futures expiry dates...
  4. other....

Due the fact NT works internal with some kind of this function it is the same like with other functions: There is an undocumented function. This is the reason why I think to write my own heavy personalized version of a chart program. There are some nice libraries which will do the whole chart rendering and I have to do the same wrapper as I do now in NT.

Started this thread Reply With Quote
  #4 (permalink)
 
AlBundy's Avatar
 AlBundy 
Vienna Austria
 
Experience: Advanced
Platform: NinjaTrader
Trading: Forex
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 12

This works fine for me:


I can write a function which reads all instruments. With some logic I can remove automatically the expired contracts; then I have more or less exactly what I wanted.

Started this thread Reply With Quote
Thanked by:




Last Updated on November 24, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts