[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 214

 
21122012 >> :

help pls,

gde osibka?


spasibo

Not enough closing brackets =)

extern double Risk=0.5;
extern int StopLoss=500;
extern int TakeProfit=50;
extern int Magic_N=12345;

int start()
{

double bt=iCustom(NULL,0,"abracadabra",0,1);
double st=iCustom(NULL,0,"abracadabra",1,1);

for(int i=OrdersTotal()-1; i>=0; i--)
{
   if(OrderSelect( i, SELECT_BY_POS, MODE_TRADES))
   {
      if(OrderSymbol()==Symbol() && (OrderType()==OP_BUY || OrderType()==OP_SELL))
      {
         if(OrderType()==OP_BUY)
         {
            OrderClose(OrderTicket(),OrderLots(),Bid,0,Green);
         }
         if(OrderType()==OP_SELL)
         {
            OrderClose(OrderTicket(),OrderLots(),Ask,0,Red);           
         } 
      }
   }
}
return(0);
}

And I advise you to structure the code - there will always be much less errors

 

super, spasibo :),

(0)errors :)

toliko pochemuto i zero sdelok :(

on doljen prodavati pri poiavlenii krasnoi arrow, pokupati pri poiavlenii green arrow,

chtoto wrong ?!

spasibo

 
21122012 >> :

super, spasibo :),

(0)errors :)

toliko pochemuto i zero sdelok :(

on doljen prodavati pri poiavlenii krasnoi arrow, pokupati pri poiavlenii green arrow,

chtoto wrong ?!

>> spasibo

It should only do what it says.

extern double Risk=0.5;     //Внешний параметр не используется
extern int StopLoss=500;    //Внешний параметр не используется
extern int TakeProfit=50;   //Внешний параметр не используется
extern int Magic_N=12345;   //Внешний параметр не используется

int start()    //Основной код советника
{

double bt=iCustom(NULL,0,"abracadabra",0,1);  //Вычисление хни которая не используется
double st=iCustom(NULL,0,"abracadabra",1,1);  //Вычисление хни которая не используется

for(int i=OrdersTotal()-1; i>=0; i--)    //Перебор открытых ордеров
{
   if(OrderSelect( i, SELECT_BY_POS, MODE_TRADES))  //Выбор ордера 
   {
      if(OrderSymbol()==Symbol() && (OrderType()==OP_BUY || OrderType()==OP_SELL))   //Если ордер на продажу или покупку
      {
         if(OrderType()==OP_BUY)    //если ордер на покупку,
         {
            OrderClose(OrderTicket(),OrderLots(),Bid,0,Green);   //то закрываем его нахрен
         }
         if(OrderType()==OP_SELL)   //если на продажу
         {
            OrderClose(OrderTicket(),OrderLots(),Ask,0,Red);     //полностью аналогично      
         } 
      }
   }
}
return(0); //Операция нас здесь не было, курим до следующего тика
}


Bottom line: open orders and run or try placing orders while the EA is running.

 


spasibo za pomoschi

i ne razbiraiiusi v programirovanie :(


hotel bil EA kotorii pokupaet/prodaiot kogda na prediduschem bili hotia bi dve strelki v tu je storu raznih iCustom indicator

tam 4 indicators, odin chart winodow, 3 separate window,

ili hotiabi daite pls prostoi EA kotorii pokupaet/prodaiot po signalam separate window indicator

eschio raz bolishoe spasibo :)

zdesi: ( http://21122112.mt4live.com ) ya tried atu strateghiu (butliko nebilo vremeni vsegda sledi za signals)

 
21122012 >> :



Taaaaakkkkkk..... What indicators did you say?

 
Colleagues, I have a question about averaging. purely mathematical. let's assume we have averaged 3 times: positions with the same volume of 1 lot. at a price of 1.8 and 1.6 and 1.4. The actual opening price here will be 1.6 . With this it is clear. But I don't understand how I can calculate the actual open price, if we opened with different lots, e.g. with an averaging factor of N. // For example: 0.1 lot and 0.2 and 0.4 - here N==2 at 1.8 and 1.6 and 1.4 . What will be the actual opening price?
 
tmp.0 >> :

Taaaaackkkkk..... What indicators did you say?

indi po stoch

 
Alex5757000 >> :
Colleagues, I have a question about averaging. purely mathematical. let's assume we have averaged 3 times: positions with the same volume of 1 lot. at a price of 1.8 and 1.6 and 1.4. The actual opening price here will be 1.6. With this it is clear. But I don't understand how I can calculate the actual open price, if we opened with different lots, e.g. with an averaging factor of N. // For example: 0.1 lot and 0.2 and 0.4 - here N==2 at 1.8 and 1.6 and 1.4 . What will be the actual opening price?

I think ((price1*ob1)+(price2*ob2)+(price3*ob3))/( ob1+ob2+ob3)

I think in case all positions are opened at the same time

 
21122012 >> :

indi po stoch

Comrade, it's a rare thing to climb the tree and not tear your trousers off. If you want an Expert Advisor and "virginity" of the system almost maintained, go to a pro. I think 100 bucks is not a problem for you. Can I give you a list?

 
tmp.0 >> :

Comrade, it is rare for anyone to climb up a Christmas tree without tearing his trousers off. If you want an Expert Advisor and "virginity" of the system, you have to go to a pro. I think 100 bucks is not a problem for you. Shall I give you a list?

konecno daite spisok esli mojno,

spasibo

Reason: