| / | Forum |
|
Alberto_jazz
2008.07.01 16:04
Hi, I’m trying to write the lot size as a function of the traded symbol, but I have an error, could you help me? Thank you!
int Lots;
if (Symbol() == EURUSD) {Lots = 0.04;} else if (Symbol() == GBPUSD) {Lots = 0.02;} else if (Symbol() == AUDUSD) {Lots = 0.06;} else if (Symbol() == EURGBP) {Lots = 0.03;} else if (Symbol() == EURJPY) {Lots = 0.03;} else if (Symbol() == USDCHF) {Lots = 0.03;} else if (Symbol() == USDJPY) {Lots = 0.04;} else if (Symbol() == EURCHF) {Lots = 0.03;} else if (Symbol() == USDCAD) {Lots = 0.05;}
|
|
Interview with Lingyu Jiang (jianglingyu) My Expert Advisor tries to catch the main trend of a day. It's based on the famous catfx50 strategy. Sometimes it will use Moving Average cross as the signal. The main indicator is StepMA. It will take 0, 1 or 2 trades a day normally, and has a StopLoss as small as 18 pips. If it wins, it makes 20-100 pips. The theory behind this expert is: "Many a pickle makes a muckle". |
|
BarrowBoy
2008.07.01 17:02
AJ What error? This code will not work on a mini account - only a micro... Have your EA check http://docs.mql4.com/constants/marketinfo for MODE_MINLOT? -BB- |
|
Alberto_jazz
2008.07.01 17:07
Yes I'm working on a micro account, this is the error 'EURUSD' - expression on global scope not allowed C:\Programmi\MetaTrader - Alpari UK\experts\Inside Bar Lots.mq4 (17, 17) |
|
puncher
2008.07.01 17:13
You have an error, because you can not trade with value less that 0.1. You have listed : |
|
Alberto_jazz
2008.07.01 17:24
I'm working on a micro account, in fact if I set the Lots as an external variable, Lots = 0.01 the expert works without problem.
|
|
Alberto_jazz
2008.07.01 18:25
Solved. The problem is that I wrote this statement BEFORE int start()! Now it works. Thank you |