[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 288

 
Roger:

For some reason, I get it right (except for the Cyrillic alphabet)

Is it right? It's the same glitch as mine.

 

Yeah, so it's a glitch.

I've found a bug. In the library for this function in the line

double DecimalArray[17]={ 1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0,  10000000.0, 100000000.0,
                             1000000000.0, 10000000000.0, 100000000000.0, 10000000000000.0, 100000000000000.0,
                             1000000000000000.0, 1000000000000000.0, 10000000000000000.0 };
you should delete zero in each of the 13th, 14th and 15th numbers.


Now correctly.

2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DTM ñ 15 çíàêàìè ðàâíî 0.201304150854320
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DTM ñ 14 çíàêàìè ðàâíî 0.20130415085432
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DTM ñ 13 çíàêàìè ðàâíî 0.2013041508543
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DTM ñ 12 çíàêàìè ðàâíî 0.201304150854
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DTM ñ 11 çíàêàìè ðàâíî 0.20130415085
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DTM ñ 10 çíàêàìè ðàâíî 0.2013041509
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DTM ñ 09 çíàêàìè ðàâíî 0.201304151
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DTM ñ 08 çíàêàìè ðàâíî 0.20130415
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DTM ñ 07 çíàêàìè ðàâíî 0.2013042
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DTM ñ 06 çíàêàìè ðàâíî 0.201304
2013.04.14 22:54:33     stdlib GBPUSD,H1: loaded successfully
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé SS = 32
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé MM = 54
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé HH = 8
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé DD = 15
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé MN = 4
2013.04.14 22:54:33     test GBPUSD,H1: Çíà÷åíèå ïåðåìåííîé YY = 2013
 
Rogerthank you so much!!! Everything worked! Now it's working as it should!
 

Hello, can anyone tell me how to make an EA out of a script?

 

Hello. I'm not good at programming, I can't find a bug, the EA runs on the tester but no trades open. Why? Please help.

//---- input parameters
extern int MA1=85;
extern int MA2=75;
extern int MA3=5;
extern int int fastema=15;
extern int int lowema=26;
extern int sl=15;
extern int tp=15;

/*
extern int vltbars=10; //number of bars for volatility calculation
extern double deliter=1.5; //current volatility divider
extern double stoppercent=0.50; //from 1 to 99

extern bool timecontrol=false;
extern string starttime = "07:00:00";
extern string stoptime = "17:00:00";
*/

extern double Lots=0.1;

int startb,starts;

double stoplevel;
int init()
{
stoplevel=MarketInfo(Symbol(),MODE_SPREAD)+MarketInfo(Symbol(),MODE_STOPLEVEL);
}


int start()
{int buy,sell;

buy=0;sell=0;
for(int i=0;i<OrdersTotal();i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderType()==OP_BUY){buy=1;}
if(OrderType()==OP_SELL){sell=1;}
}

double wma1 =iMA(NULL,0,MA1,0,MODE_LWMA,PRICE_LOW,1);
double wma2 =iMA(NULL,0,MA2,0,MODE_LWMA,PRICE_LOW,1);
double ema1 =iMA(NULL,0,MA3,0,MODE_EMA,PRICE_CLOSE,1);

double macdcurr =iMACD(NULL,0,fastema,lowema,1,PRICE_CLOSE,MODE_MAIN,1);
double macdlast =iMACD(NULL,0,fastema,lowema,1,PRICE_CLOSE,MODE_MAIN,2);


if(ema1<wma1 && ema1<wma2)startb=1;
if(ema1>wma1 && ema1>wma2)starts=1;

if(ema1>wma1 && ema1>wma2 && startb==1 && (macdcurr>0 || macdcurr>macdlast) && buy==0)
{
Print("BUY Bid: "+Bid+" sl: "+sl+" TakeProfit: "+tp);
OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-sl*Point,Ask+tp*Point, "FORTRADER.RU",0,0,Red);
startb=0;
}
if(ema1<wma1 && ema1<wma2 && starts==1 && (macdcurr<0 || macdcurr<macdlast)&& sell==0)
{
Print("SELL Bid: "+Bid+" sl: "+sl+" TakeProfit: "+tp);
OrderSend(Symbol(),OP_SELL,0.1,Bid,3,Bid+sl*Point,Bid-tp*Point, "FORTRADER.RU",0,0,Red);
starts=0;
}

return(0);
}


 
qwert2:

Hello, can anyone tell me how to make an EA out of a script?

Put it in the EA folder.
 
Zhunko:
Put it in the Expert folder.

The script performs the action, if you just move it to the experts folder it performs the action every tick, instead of starting a new action only after the old one is finished.

 
qwert2:

The script performs the action, if you just move it to the Expert folder it performs the action every tick, instead of starting a new action only after the old one is finished.

I don't get it. What is this about? Is it a question?
 
Zhunko:
I don't get it. What's this about? Is that a question?

I wrote this about what happens if you just move the script to the experts folder. It works, but not in the way we need it to. The script creates 8 pending orders. If we just save it in the Expert Advisors folder, it creates 8 pending orders after each tick. I need it to place 8 new orders only after the old ones are closed.
 
qwert2:
This is what happens if the script is simply moved to the experts folder. It works, but not the way it should. The script creates 8 pending orders, but if you just save it in the experts folder, it creates 8 pending orders after each tick. I need it to place 8 new orders only after the old ones are closed.
Aren't you mixed up in anything - maybe a chicken would be a BETTER (for pending)? :)))