-
if("CCI" > 105) if("MACD" > Signal_MACD_PeriodSignal) //If the MACD is above the signal line we are going if("EMA" > Signal_DEMA_Weight) //If the candles are above the EMA
When is a string ever greater than that int? Answer: always. “A” - “Z” is always greater than “0” - “9”.
-
trade.Buy( 0.1, //Lots NULL, //current symbol Ask, //buy price Ask-30*_Point, //Stop Loss Ask+20*_Point, // Take Profit NULL //comments );
You buy at the Ask and sell at the Bid. Pending Buy Stop orders become market orders when hit and open at the Ask.
-
Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice reaches it. Using Ask±n, makes your SL shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?
-
Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice reaches it. To trigger close to a specific Bid price, add the average spread.
MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25 -
The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (control+O) → charts → Show ask line.)
Most brokers with variable spreads widen considerably at end of day (5 PM ET) ± 30 minutes. My GBPJPY shows average spread = 26 points, but average maximum spread = 134 (your broker will be similar).
-
- Fujin: Can somebody help me to find the error?
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I built this bot but when i try out this bot on the strategy tester,
didint work out at all, like its didnt give any signals for the oppurtinty ''Buy''
Can somebody help me to find the error?
Thank you!