Click here to Login





                                                   Debugging a function

  0

0
Dirk
2013-10-15 10:48:38


In the "Script" part of the "Create Functions" Window:
Is it possible to somehow debug my code with sample data, that is going through it line by line and see what values the variables will hold?

Keep up the awesome work on Quantshare!!
All the best
Dirk



QuantShare
2013-10-15 20:14:14

  0

Hi Dirk,

You can use the "Global.Trace" function to display what values the variables hold.

Example:

VectorD c = cFunctions.Close;
VectorD e = c / 2;

for(int i=0;i<e.Length;i++)
{
Global.Trace("Index: " + i + " - Value: " + e[i]);
}

// Add the function in a chart to display the data in the "View -> Output" window.



Colibri
2018-07-02 22:08:46

  0

How can I debug a variable inside a script though?


QuantShare
2018-07-04 13:09:07

  0

As specified above, please use "Global.Trace" function.


Colibri
2018-08-03 14:23:45

  0

Will this also work say inside a function that is inside a pre-script downloader?


QuantShare
2018-08-06 08:23:39

  0

Yes it will.


No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
News parser function
Advanced Quotes and Custom Databases Function
Swing Point Function (SP)
NORMDIST - Normal Probability Density Function
Day of week and Week number function

How-to Lessons
Difference between the watchlist and the screener tools
How to plot two different time frames in the same chart
How to set order type of a trading system programmatically
How to display the bar index of a stock on a chart
How to screen for stocks having a high correlation with the Dow J...

Related Forum Threads
Calling a Function from another Function
Comp Function
Logging the Comp() function
Composite Function
SetSimTiming function parameters & usage

Blog Posts
How to create market indicators using the composite function - Pa...
The 'inside period' function
How to create market indicators using the composite function - Pa...
How to create market indicators using the composite function - Pa...
Create Your Own Tactical Asset Allocation Strategies









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.