Raiden_IBFX_High-to-Medium (by Raiden) Snabbstatistik
Vinst: +181.52%
Förlustsekvens: 19.12%
Pips: 533.2
Positioner: 444
Vunna:
Förlorade:
Typ: Demo
Hävstång: 1:400
Handel: Automatiskt

Full rapport

Användares sida

Meddelande

Rating: Empty Star Empty Star Empty Star Empty Star Empty Star
Raiden_IBFX_High-to-Medium Diskussion
Föregående 1 2 3 4 5 6 Nästa
Raiden

Medlem sedan Nov 27, 2010  243 poster www.raidenworks.com (Raiden) Apr 27 2011 at 10:26
Yes, I see where you're coming from. It is always interesting to study other posters' statements.
However, while I do keep a massive number of workfiles and a large changelog, I'm not prepared to publicly post that information. I don't see any upside doing so, apart from perhaps satisfying some peoples' curiosity but that's not my objective. The potential downside, however, is large, for reasons people who have seen dealing desks being operated physically would know.

I would make my live accounts public were I advertising to be a manager but I'm not. And neither am I selling the EA or signals. What would one expect to achieve from doing so? Repute?

Consistency above all.
speki

Medlem sedan Nov 18, 2009  735 poster speki Apr 27 2011 at 10:54
Upside could be you come accross people who can contribute to your work. There are some veteran programmers here - to name but one: Edward - chances are he could give you a few tips on how not to flood the server.

Do you care to explain this:

<i>The potential downside, however, is large, for reasons people who have seen dealing desks being operated physically would know</i>

You mean you could get hosed by the broker if they knew your trading?

Either way, I'm interested in how dealing desks are being operated ... if you could share this information ... thanks.

Surround yourself with people whose eyes light up when they see you and who have no agenda for your reform.
Raiden

Medlem sedan Nov 27, 2010  243 poster www.raidenworks.com (Raiden) Apr 27 2011 at 11:28
The repository of coding information and congregation of coders is not as rich as on the mql4, ForexFactory, Forex-TSD, TradingSystemForex forums. I honestly don't get any coding information from here.

The flooding of OrderModify attempts was logically unjustified. Error logs could not explain why 0.12345==0.12345 was not true.
I had thought it was something endemically wrong with my code and I spent a LOT of time rewriting stuff and still couldn't work around it, hence the hair pulling.

In my case, it was specifically to do with the floating point of the Double variable OrderStopLoss() when compared with a StopLoss value calculated from OrderOpenPrice(). E.g. 0.1234567890123456==0.1234567890123451, which will show up as 0.12345==0.12345, will return false and this was likely the case.
See http://www.forexfactory.com/showthread.php?t=236951

Consistency above all.
speki

Medlem sedan Nov 18, 2009  735 poster speki Apr 27 2011 at 11:45
You see? Ask, and it shall be given you; seek, and ye shall find; knock, and it shall be opened unto you.
Without looking at the ForexFactory link, here's a tip:
(it's on the page 4 in the <i>'Teach yourself MQL4 in 21 days'</i> ebook) always use NormalizeDouble.
Never worked with floating point numbers before? smiley

Surround yourself with people whose eyes light up when they see you and who have no agenda for your reform.
Raiden

Medlem sedan Nov 27, 2010  243 poster www.raidenworks.com (Raiden) Apr 27 2011 at 12:24 (editerad Apr 27 2011 at 12:33 )
Good that we are discussing this as I feel I need to ask this. (Code has been truncated and simplified to leave out irrelevant bits)
If you have:

extern int StopLoss=30;
Start(){
if(OrderStopLoss()!=(OrderOpenPrice()-StopLoss*Point))
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-StopLoss*Point),0,Red); //for buy orders
}

Why would anyone reason that OrderOpenPrice()-StopLoss*Point would generate a different number than OrderStopLoss()?
It's a genuine bug.

Another thing why I don't discuss code here is that there's no formatting available unlike in the other forums I mentioned above. It would be a good addition and has been suggested.

The e-book is clearly wrong(can you provide the link?), it's not a good idea to NormalizeDouble at all when calculations are being done.

Consistency above all.
speki

Medlem sedan Nov 18, 2009  735 poster speki Apr 27 2011 at 12:34
My friend if you do some binary / floating point arithmetics by hand (on paper), you'd know it's possible that for example, OrderStopLoss returns 1.234500000000 while the result of <i>OrderOpenPrice() - StopLoss * Point</i> would be 1.234500000074857485 something. That's the way floating point numbers work. I wouldn't say it's a bug or a feature, anyway if you use Normalize, you can get what you want without the fuss. But I'm not the sharpest knife in the cupboard ... maybe Edward can give you a better explanation.




Surround yourself with people whose eyes light up when they see you and who have no agenda for your reform.
speki

Medlem sedan Nov 18, 2009  735 poster speki Apr 27 2011 at 12:37 (editerad Apr 27 2011 at 12:38 )
Ok, I'm not arguing with the chaps over at MetaQuotes ... are you? lol

http://docs.mql4.com/convert/normalizedouble

Surround yourself with people whose eyes light up when they see you and who have no agenda for your reform.
Raiden

Medlem sedan Nov 27, 2010  243 poster www.raidenworks.com (Raiden) Apr 27 2011 at 13:15
speki posted:
    My friend if you do some binary / floating point arithmetics by hand (on paper), you'd know it's possible that for example, OrderStopLoss returns 1.234500000000 while the result of <i>OrderOpenPrice() - StopLoss * Point</i> would be 1.234500000074857485 something. That's the way floating point numbers work. I wouldn't say it's a bug or a feature, anyway if you use Normalize, you can get what you want without the fuss.


I have to elaborate, immediately after my OrderSend, I successfully OrderModify by
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-StopLoss*Point,0,Red)

Notice no NormalizeDouble.

When I perform a check as in my previous post:
if(OrderStopLoss()!=(OrderOpenPrice()-StopLoss*Point))
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-StopLoss*Point,0,Red); //for buy orders
}

I get the OrderModify Error#1 that can only be resolved by writing this:
if(OrderStopLoss()!=(OrderOpenPrice()-StopLoss*Point))
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()-StopLoss*Point,Digits),0,Red); //for buy orders
}

Why would OrderStopLoss()!=OrderOpenPrice()-StopLoss*Point return true? It doesn't make any logical sense.

To be forced to use a NormalizeDouble is sloppy but I'm sure Metaquotes has their reason. Note that this issue was addressed by bugfixes in several MT4 releases but it clearly isn't not resolved completely. It should be better documented on their site.

And generally, rounding numbers before calculations are made gets ultimately the wrong answer, particularly with numerous calculations.

Consistency above all.
speki

Medlem sedan Nov 18, 2009  735 poster speki Apr 27 2011 at 14:14
Lives and learns, my friend ...
You were lucky if it actually worked w/o Normalize.

I don't think it's only the sloppyness of Metaquotes ... it's something about floating point numbers ...

http://www.google.com/search?q=floating+point+comparison+problem

you see what Microsoft says about it?
http://support.microsoft.com/kb/69333

quote: <b>NO OTHER TEST FOR EQUALITY WILL BE RELIABLE.</b>

This is also interesting, how 1.1 is in fact 1.099999904632568359375

http://stackoverflow.com/questions/3962724/problems-in-floating-point-comparison

Surround yourself with people whose eyes light up when they see you and who have no agenda for your reform.
Raiden

Medlem sedan Nov 27, 2010  243 poster www.raidenworks.com (Raiden) Apr 27 2011 at 20:49 (editerad Apr 27 2011 at 20:51 )
To summarise:

OrderStopLoss = A
OrderOpenPrice = B
StopLoss*Point=C

A=B-C

if(A is not equal to B-C) <b>make</b> A equal to B-C
test if A is now equal to B-C

OrderModify Error#1
OrderModify Error#1
OrderModify Error#1
OrderModify Error#1
...
..
.
*faint*

The point I would like to make is that OrderStopLoss() and OrderOpenPrice() are calculated differently by MT4. I do understand the computational limits of floating point numbers, but thank you for the links nonetheless, they are interesting and useful reads.

And you must understand it from my perspective when I first came across it, I didn't know it could be resolved by rounding. I thought it was an OrderModify problem and I scratched my head for a whole day reworking the OrderModify itself. I suspect comic relief from a coding angle is rather dry for most people so I'll leave it as that. Thanks for discussing though.

Consistency above all.
Föregående 1 2 3 4 5 6 Nästa
Vesak Day (55 min)
Commodities Brief: Oil able to hold previous...(6 min ago)
EURUSD 1.29296 GBPUSD 1.51034
USDJPY 102.05 USDCAD 1.03056
Tools Community Recensioner Plattform Company Hjälp
Ekonomisk kalender Community Mäklare Widgets Om FAQ
Forex Market System Expert Advisors Funktioner Blogg Hjälp
Forex Volatility Most Popular Systems Signalleverantörer API Twitter Kontakta oss
Forex Correlation Strategier VPS Services Mobile Facebook Rapportera ett fel!
Forex Broker Spreads Tävlingar EA Programming Översättningar    
Forex Broker Quotes Forex Charts PAMM Brokers RSS    
Forex Broker Swaps Community Outlook Rebate Programs      
Streaming Forex News   Trading Platforms      
Forex Broker Volume          
COT Data New          

Sitekarta  |   Terms & Conditions  |   Privacy Policy
©2012 Myfxbook Ltd. All Rights Reserved.
HIGH RISK WARNING: Foreign exchange trading carries a high level of risk that may not be suitable for all investors. Leverage creates additional risk and loss exposure. Before you decide to trade foreign exchange, carefully consider your investment objectives, experience level, and risk tolerance. You could lose some or all of your initial investment; do not invest money that you cannot afford to lose. Educate yourself on the risks associated with foreign exchange trading, and seek advice from an independent financial or tax advisor if you have any questions. Any data and information is provided 'as is' solely for informational purposes, and is not intended for trading purposes or advice.