- m00nlyte: but these errors I have no idea.
STP = STP*10 TKP = TKP*10 //this is line 46
No terminating semicolons.
-
if(Buy_Condition_1 && Buy_Condition_2) { if(Buy_Condition_3 && Buy_Condition_4) {
Two open parentheses without closing equivalents. - Likewise, Sell_Condition…
-
int CopyBuffer( int indicator_handle, // indicator handle int buffer_num, // indicator buffer number int start_pos, // start position int count, // amount to copy double buffer[] // target array to copy );
Why do you have a function prototype inside a function?
-
No terminating semicolons.
- Two open parentheses without closing equivalents.
- Likewise, Sell_Condition…
- Why do you have a function prototype inside a function?
1: fixed
2&3: I added semicolons, which prompted the warning "empty controlled statement found" , I removed the semicolons, and the warnings went away, probably because these don't contain instructions?
4: oops :) removed
Code now has 0 errors .
If you don't mind I have one more question:
For mrequest.sl = NormalizeDouble(latest_price.bid + STP*_Point,_Digits); is
is it necessary to multiply by point? this is for sell side order, the STP already multiplied by 10 to account for 5/3 digit quotes.
Many thanks to you!
Cheers
For mrequest.sl = NormalizeDouble(latest_price.bid + STP*_Point,_Digits); is
is it necessary to multiply by point? this is for sell side order, the STP already multiplied by 10 to account for 5/3 digit quotes.
-
SL is a price; a price ± 100 is not. OOP ± STP × 10 × Point = OOP ± STP × PIP = a price.
PIP, Point, or Tick are all different in general.
What is a TICK? - MQL4 programming forumUnless you manually adjust your SL/TP for each separate symbol, using Point means code breaks on 4 digit brokers, exotics (e.g. USDZAR where spread is over 500 points,) and metals. Compute what a PIP is and use it, not points.
How to manage JPY pairs with parameters? - MQL4 programming forum
Slippage defined in index points - Currency Pairs - Expert Advisors and Automated Trading - MQL5 programming forum - used NormalizeDouble, It's use is usually
wrong, as it is in your case.
- Floating point has infinite number of decimals, it's your not understanding floating point and that some numbers can't be represented
exactly. (like 1/10.)
Double-precision floating-point format - Wikipedia, the free encyclopedia - Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.
- SL/TP (stops) need to be normalized to tick size (not Point) — code fails on metals. (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 programming forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 programming forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 programming forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 programming forum
- Lot size must also be adjusted to a multiple of LotStep and check against min and max. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
- MathRound() and NormalizeDouble() are rounding in a different way. Make it explicit.
MT4:NormalizeDouble - MQL5 programming forum
How to Normalize - Expert Advisors and Automated Trading - MQL5 programming forum - Prices you get from the terminal are already normalized.
- PIP, Point, or Tick are all different in general.
What is a TICK? - MQL4 programming forum
- Floating point has infinite number of decimals, it's your not understanding floating point and that some numbers can't be represented
exactly. (like 1/10.)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
After a while I got the code down to these errors. I have tried many things but these errors I have no idea. Also a question: do you have to include the struct properties in the code for every one you use? Please excuse my noviceness. Edit: I commented in the code the lines with errors