I ran your EA in the Strategy tester on GBPUSD from 1st Jan 2011 to 19 August 2011 (last Friday), it didn't start making any orders until 25th July and it placed 20 orders.
Did you really mean to have a TP of 350 pips ?
I don't think your K variable is doing what you would like it to do, check it's effect on your spread check and it's effect on the TP
bool price_above=false; int init(){ if ( Ask > iMA(Symbol(),15,ma_value,0,MODE_SMA,PRICE_TYPICAL,0) ) price_above=true;
- Each time you change pair, TF, or refresh the chart, you go through a deinit/init cycle. The EA is NOT reloaded. Thus once price_above gets set to true it will ALWAYS be true.
- Don't you want that variable to be correct on every tick? Must be in start() then
price_above = ( Ask > iMA(Symbol(),15,ma_value,0,MODE_SMA,PRICE_TYPICAL,0) );
int K = 1 ; // point * K (in demo account use 10, in real account use 1)
Not true. It depends on both the broker and the account type. IBFX has both 4 and 5 digit real accounts (last time I looked.) Don't hard code. Also you must adjust ALL pip values and that includes SLIPPAGE//++++ These are adjusted for 5 digit brokers. int pips2points; // slippage 3 pips 3=points 30=points double pips2dbl; // Stoploss 15 pips 0.0015 0.00150 int Digits.pips; // DoubleToStr(dbl/pips2dbl, Digits.pips) int init(){ if (Digits == 5 || Digits == 3){ // Adjust for five (5) digit brokers. pips2dbl = Point*10; pips2points = 10; Digits.pips = 1; } else { pips2dbl = Point; pips2points = 1; Digits.pips = 0; } // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
M=(AccountBalance()*0.005*Z)/(0.1*stoploss) ; // x% risk per trade
If you open one lot on EURUSD with a 10 pip stop loss you are risking 10 pips * $10/pip/lot or $100. If you open the same one lot with a 100 pip stop loss you are risking $1000. Eventually you're going to have to use a real calculation, see my Lotsize code.(ATR<0.0040)
This makes the EA incompatible with any JPY pair. Don't hard code numbers: ATR < 40*pips2dbl
WHRoeder:
- Each time you change pair, TF, or refresh the chart, you go through a deinit/init cycle. The EA is NOT reloaded. Thus once price_above gets set to true it will ALWAYS be true.
- Don't you want that variable to be correct on every tick? Must be in start() then
- Not true. It depends on both the broker and the account type. IBFX has both 4 and 5 digit real accounts (last time I looked.) Don't hard code. Also you must adjust ALL pip values and that includes SLIPPAGE
- If you open one lot on EURUSD with a 10 pip stop loss you are risking 10 pips * $10/pip/lot or $100. If you open the same one lot with a 100 pip stop loss you are risking $1000. Eventually you're going to have to use a real calculation, see my Lotsize code.
- This makes the EA incompatible with any JPY pair. Don't hard code numbers: ATR < 40*pips2dbl
thanks a lot !!!!!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hi !
until ATR went above 0.0040
the program used to work good !
now after ATR went below 0.0040 and the conditions for a trade are met it fails to make trades
please help