William Roeder:
- It's not working because you don't save anything between ticks (init_p and cnt are zero each tick). You would if they were static/global variables.
- It's not working because truncating to an int. Prices are doubles.
Please help me with correct code snippet, i have tried changing the int to double and the variable type. Thanks in Advance.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Please any help on why this code is not working.
i need a code to calculate consecutive up tick and down tick to get how fast price is moving in each direction.