stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Magic Numbers
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1153
Page 1 of 1
Author:  garyfritz [ Wed Nov 21, 2012 8:40 pm ]
Post subject:  Re: Magic Numbers

followNev wrote:Do I simply write the code as:
if ( OrderMagicNumber () != MagicNumberLong) continue;
if ( OrderMagicNumber () != MagicNumberShort) continue;
?
No -- if the # is MagicNumberShort, the first test will skip to the next order and you'll never see your short order.

You could do something like

if ( OrderMagicNumber () != MagicNumberLong && OrderMagicNumber () != MagicNumberShort) continue;

That way, it only skips to the next order if the # isn't your long # AND it isn't your short #.
Author:  SteveHopwood [ Wed Nov 21, 2012 9:22 pm ]
Post subject:  Re: Magic Numbers

followNev wrote:Thank you garyfritz.
I'll try your way, as mine compiles without errors but obviously didn't work out the way I wanted it too. :|
I know the feeling. :lol:

Keep going, won't you? You would not believe what I was hard-coding in my early days with this stuff. I had hard-coded Digits before I discovered Digits. :lol: Yep. Really. Not joking.

Ignore any subsequent comments about my coding by Gary. He once managed to ban himself, and so has not a leg to stand on. :lol:

:D
Author:  garyfritz [ Wed Nov 21, 2012 9:38 pm ]
Post subject:  Re: Magic Numbers

I'll point out that as a result, *I* have valuable life experience you do not. Keep that in mind, sirrah. :lol:
Author:  Jemook [ Wed Nov 21, 2012 10:15 pm ]
Post subject:  Re: Magic Numbers

SteveHopwood wrote:Ignore any subsequent comments about my coding by Gary. He once managed to ban himself, and so has not a leg to stand on. :lol:

:D
Cracks me up every time!
Author:  SteveHopwood [ Wed Nov 21, 2012 10:24 pm ]
Post subject:  Re: Magic Numbers

Jemook wrote:
SteveHopwood wrote:Ignore any subsequent comments about my coding by Gary. He once managed to ban himself, and so has not a leg to stand on. :lol:

:D
Cracks me up every time!
Me too. That is why I bring it up from time to time, even though I promised not to. Gary takes it like a real trouper.

:D
All times are UTC Page 1 of 1