[FAQ] = = = How to Get Help = = =

Read before posting.
User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

[FAQ] = = = How to Get Help = = =

Postby TJ » 10 Jan 2013

1. [FAQ] How to Post Codes ... so that people can read.

When you post codes without code tags, they look like ordinary text.
If your post is long and intertwined with codes and texts, the code will blend in with your message, making it difficult to read (and comprehend). If you are asking for help, you would want to make it as easy as possible for people to help you, including making your code easy to read.


Untagged codes look like this: everything is intertwined in a confused mess

can someone help me with this code? it is not doing what I want. It compiles and plots
but does not give correct value.
Function for DMI Oscillator;
inputs: Price( Close ), Length( 20 ), ConfirmBars( 1 ), //MA
FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ; //MACD
variables: var0( 0 ), //MA
var1( 0 ), var2( 0 ) ; //MACD
var1 = MACD( Close, FastLength, SlowLength ) ;
var2 = XAverage( var1, MACDLength ) ;
ps. Oscillator value should be above zero line when +DMI is above -DMI.
You cannot tell the difference between the code and your message.


You can show the codes separately in a Code Box, with formatting, thus making reading easier.

Tagged code looks like this -- the script is enclosed in a box:

Code: Select all

Inputs: Price( Close ), Length( 20 ), ConfirmBars( 1 ), //MA FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ; //MACD Variables: MA( 0 ) , //MA MA.CD( 0 ) ; //MACD MA.CD = MACD( Close, FastLength, SlowLength ) ; MA = XAverage( var1, MACDLength ) ;

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

2. How to Post Codes

Postby TJ » 10 Jan 2013

Here's how to tag codes:

When you are posting your message,

Step 1: Highlight the code portion of the message you are about to post. (see blue colored section below)

Step 2: Click on the </> button located at the top of the message window

That's it, you have tagged your code, and the code will be presented in a box for easy reading.

Image
You do not have the required permissions to view the files attached to this post.

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

3. How To Speed Up Your Help Process

Postby TJ » 15 Aug 2015

How To Speed Up Your Help Process

If you ask a simple question, you will get a simple answer.
If you ask a general question, you will get a general answer.
If you ask a specific question, you will get a specific answer.
If you ask a detailed question, with illustrations, you will get a detailed answer, with examples.
If you ask a lazy question, you will get a lazy answer.

There are no stupid questions.


Before you ask your question, have the following information ready (where applicable):

1. Which version of MultiCharts are you using?
-- don't just say the "latest one"; go to MultiCharts>Help>About and copy the version number

-- What is your hardware? CPU, RAM, Harddisk, SSD? RAMDisk?
-- What is your operating system?

2. Who is your broker/dataprovider?
If the problem is data/order related . . .
-- What is the version of the broker software?
-- Does it require Java?
-- Is this a demo account? or paper trading account?

3. What is the instrument? What is the symbol? How many data streams?
(does the problem happen to all the symbols?)

4. What is the chart resolution? 5 min? tick? 24 hr session?
(does the problem happen to all the chart resolutions?)

5. When do you observe this problem?
Portfolio trader? Real-time? Backtest? Walk forward test? Optimization? After hour? Fast market?

6. Describe your problem, and tell us your expectation;
-- don't just only say "it is not working". (see post #4 below)
-- if you copied the code from the internet, tell us where did you find it. Give us the background, so that we do not have to do unnecessary detective work.

7. Take a screenshot of the error message. Don't just say "it has error", or "it won't compile".

8. Post your codes. Nobody can give you coding help if you don't post your codes.

9. Post screenshots of your chart. Draw diagrams. (Write notes on the picture to point out the problem area).

10. Make a video if the problem is a moving target.

This is a good example of presenting your problem
viewtopic.php?f=1&t=50847

If the problem is system or environment related,
11. What is your hardware? CPU, RAM, Harddisk, SSD? RAMDisk?
12. What is your operating system? 32 or 64 bit? Are you using it on top of Apple or Linux OS?
13. What is your internet service? What type of router?
14. Is this a hosted system at a remote site? VPS? or shared system in a server?
15. Have you changed any registry settings?
16. Do you use anti-virus? firwall? VPN?
17. What other programs you are running? Browser? Games? Screencapture?

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

4. Debugging YOUR code

Postby TJ » 15 Aug 2015

How to Get Help -- Don't just say... "It is not working"
Subtitle: We cannot read your mind.

Tell us What is not working
Tell us How is it not working
Tell us When is it not working
Tell us Where is it not working
Tell us What is the expected behavior?

We can only help you with the information you provide us.






1. Do not expect others to instantly observe the same problem you do.
Two people could be running the same script, but never experience the same problem.
If you are asking a coding question... ** Post your codes **
Tell us what your code is supposed to do.
Describe what you want to see, and describe in fact what is happening that you believe is "wrong".
Make printouts, make screenshots, DRAW a diagram, write notes on the chart.
If the logic involves more than one If-Than-Else, please draw a flowchart.
A picture is worth a thousand words.

2. Don't just say "It is not working", or "It's wrong", or "It's won't compile".
We cannot see your computer screen, and we cannot read your mind.
You need to describe the problem, make print outs, post your codes,
-- POST A SCREEN SHOT OF YOUR CHART --
-- POST A SCREEN SHOT OF YOUR CHART --
-- POST A SCREEN SHOT OF YOUR CHART --
-- write notes on the chart to point out the problem.
-- MAKE A SCREENSHOT OF THE ERROR MESSAGE --

3. Tell us where did you get the code.
Did you write it yourself? or did you copy it from somewhere?
Tell us the background of this code -- don't make us guess in the dark.

If you need coding help
-- POST THE CODE -- -- POST THE CODE -- -- POST THE CODE --
-- POST THE CODE -- -- POST THE CODE -- -- POST THE CODE --


If you need coding help
-- POST THE COMPLETE CODE --
Don't expect someone to decipher the problem from a single line of code.

-- POST THE SOURCE OF THE CODE --
If you have made changes to other people code, tell us what changes have you made?


4. When and where do you observe this problem?
In the Portfolio trader? Real time or Backtest?
Walk forward test? Optimization? After hour? Fast market only?
Do you see the same problem with all the symbols?
Do you see the same problem with different chart resolutions?

5. Tell us what debugging efforts you have made, so that we do not waste time duplicating your tests.

6. Ask and Ye Shall Be Given
If you ask a general question, people will give you a general answer.
If you ask a hypothetical question, people will give you a hypothetical answer.
If you ask a specific question, people will give you a specific answer.
If you ask a coding question, post your codes.

7. Don't make people guess what you want.
We don't assume, because... It will make an ASS out of U and ME

8. Don't say "I need help" and expect someone to write the complete code for you.
-- Show us your efforts: this is your project, not ours.
-- Describe your project: Describe you want to do. Don't just say "I want this".
-- Show us your flow chart. (Google/Youtube if you don't know what it is)
-- Show us a mockup drawing. If it involves plotting, show us how it should look.
-- What is your problem? we can help you with syntax questions and logic debugs.
-- For complex projects, you might need to hire a professional programmer.

9. If you have a problem expressing your words in English, you might want to write your questions in your native language . It is easier to use Google-Translate on your native language than to guess on your wrong English words. We have users from around the World, one of us might understand.



ps. The phrase "It is not working" could mean one of a million things:
** and each problem requires a different debugging method **
a) the indicator/strategy did not compile
b) the indicator/strategy compiled, but with error message when applied to a chart
c) nothing is shown on the chart
d) the chart crashes when the study is applied
e) the chart is slow
f) the color is wrong
g) the plot disappeared
h) XYZ variable makes the wrong calculation
i) floating point error
j) the order does not trigger
k) the order triggers sometimes but not the other times
l) the order triggered for one symbol but not the other
m) the order triggered at the wrong time
n) the order triggered at the wrong place
o) wrong type of order was triggered
p) wrong quantity
q) wrong price filled
r) no trades reported
s) ...

You get the idea.

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

5. The First Step in Debugging Your Code

Postby TJ » 22 Sep 2015

5. Open Your Eyes ! Stop Banging Your Head Against the Wall !


THIS IS A #1 MUST DO before you start to debug --> Replace all the Generic Variable Names with Meaningful Names.

ie. Remove these cryptic codes:
value1, var01, condition1, condition2... etc.,

and Replace them with names that associate with their purposes
eg. Avg20, GoingUp, NewHigh, etc.,

For example: Original cryptic codes:

Code: Select all

value1 = Average( close, 20 ); condition1 = value1 > value1[1];
Change them to "Read-and-Understood" codes:

Code: Select all

var: Avg20(0); Avg20GoingUp( False ), Avg20GoingDn( False ); Avg20 = Average( Close, 20 ); Avg20GoingUp = Avg20 > Avg20[1]; Avg20GoingDn = Avg20 < Avg20[1];

You will appreciate the meaningful variable names when you have to revisit your codes 3 months from now.

ps. As a practice, I do not review codes with cryptic variable names.
It is a hassle and a waste of time to go back and forth to trace the purpose of the variables in order to see the logic.

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

6. Developing Your Strategy

Postby TJ » 13 Oct 2015

6. Developing Your Strategy

First Step -- Draw a diagram to illustrate your idea

2nd Step -- Write out your logic in Plain English -- Step-by-Step, One Step per Line

Next -- Draw a Flow Chart to illustrate your logic

Start here if you want to write your own analysis:
viewtopic.php?t=6929

For example:

Image

Image
You do not have the required permissions to view the files attached to this post.

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

7. Error Messages

Postby TJ » 26 Sep 2017

7. POST YOUR ERROR MESSAGE

How could people help you if you do not let them know the error?



Image

Image

Image

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

8. Code Conversion

Postby TJ » 26 Oct 2020

8. Code Conversion

If you need help with code conversion . . .

Please don't just post the codes.

You need to provide the following:
(The more information you have, the easier it is for people to help you)

1. Where did you get the code? Link to the source? (Please give credit to the author)
2. What is the language of this code?
3. What is the background of this code (Don't make us guess!)
4. What does this code do? Please describe its functions and features.
5. Please post screenshots or diagrams to illustrate what does this code do.

If you provide people with nothing, you will get nothing in return.


Return to “MultiCharts FAQ”