if(BandsBreakUp){ if(CanOpenBuy && CanOpenSell && CanOrder) OpenNew(OP_SELL); } if(BandsBreakDown){ if(CanOpenSell && CanOpenBuy && CanOrder) OpenNew(OP_BUY);
-
As desertkids said.
-
Always buying is a looser. Changing to always selling is also a looser.
-
OpenPrice=Ask; SLPrice=OpenPrice-SL; TPPrice=OpenPrice+TP;
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).
-

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Currently, the EA will open a buy position on certain conditions, or will open a sell position on certain conditions. I have no experience with MQL scripting, and wanted to know what would I need to change in the script, to simply have it do the opposite (instead of opening a buy position it'll instead open a sell position, and vice versa)?
I know it's probably a simple line or 2 of code that could be edited to make these changes, just not 100% sure which and what to change it to.