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
Ickyrus,
Thanks for the response. I'm still not certain on how I go about making sure I'm using the correct double values for my calculations. What I mean is when I print just the value of Bid, there are only 4 digits after the decimal point. I'm trying to figure out how I should write everything so that both my calculations and the values that get sent to the dealers server are correct. The only way I could get it to print all 5 digits after the decimal was by using the code pasted above with the DoubleToStr. How should I write that so that the correct values are being used within the program and displayed correctly?
Where posible use integer arithmatic - it a little faster than floating point. For all averaging and statistical calculations use double. Where sending values to the dealer use NormalisedDouble function there is a global variable that tells you how many decimal places the dealer uses. In your actual program, unless appropriate to round, keep your floating point numbers as unrounded as possible.
Do a Google search for computer arithmatic for a better understanding Wickipedia should have a good article on it.
What you seem to be worying about is the displaying of the internal representation of a floating point number - just leave that to the print function.
Sample of absolutely precise price operations
In the future all my internal prices presentations and operations will be integer
Thanks for answering my question guys. Working all day today but looking forward to getting back to working on writing my first programs tomorrow. I'll let you know how it goes as I progress.
Been working on a MA crossover indicator for practice. Was hoping for some more pointers and advice as a I progress here. A few things I'm unsure of is if there is a better way to write the counted_bars/iHistory lines of the DrawMA() function? I don't understand why I can't jsut remove those lines and set int i equal to iHistory. How do I make sure the objects I'm creating to mark the crossovers are centered right on or around the crossover point? I'm still really trying to make sure I understand everything as I move on so any suggestions about anything I'm missing or should have written in a better way are much appreciated. Thanks.
Ok. Found an error when the crossover was taking place on the current bar and it was trying to create an object that was already there. Fixed that one I think but would still appreciate any suggestions anyone has to improve my first indicator. Thanks
Would still really appreciate any comments regarding my past posts. Continuing to learn here, have been trying to figure out how to use candle direction as a signal. Been working on trying to figure this out for a while I'm looking for a little advice or where to look for an example. I'm starting with writing an idicator to tell me the direction of each of the last 100 hour bars and the direction of the corresponding daily bars at that time. Really having trouble figuring this one out...
I have some ideas I've been trying to test out such as just using division of hours to determine what day it would be but can't even figure out how to get the hour for the current bar im checking. I'll add the code I was playing around with trying to figure it out. Please help...
Use the standard code for counting.
Thanks for the response. Been playing around with the suggested idea not to use objects and to rather use buffers. I know I am close but can't seem to get this to put the arrow only on the necessary points. Tried all sorts of ways for a couple hours again and cant seem to get it. Any suggestions? Thanks.