I need someone to program an EA - page 3

 
hardyyanto:

ya, zzuegg..

but in 1 year, there is 1 or 2 month that can lose.. because sometimes in the morning, usdjpy can moving more than 150 pips in 5 minutes, if our ea open wrong position, so say good bye to margin.. hehe..

averaging and hedging ( martiangle) is the patner like brother sister that have opposite weakness, but that method that very many people using that for keep ea still longer profit..


i never said martingale is good. i would never use full martingale system (doubling the lotsize) in livemode. but there are other possibilitys.
OrderSelect(total-1, SELECT_BY_POS, MODE_TRADES);

that line makes me cry. ;)


//z

 
hardyyanto:

ya, zzuegg..

but in 1 year, there is 1 or 2 month that can lose.. because sometimes in the morning, usdjpy can moving more than 150 pips in 5 minutes, if our ea open wrong position, so say good bye to margin.. hehe..

averaging and hedging ( martiangle) is the patner like brother sister that have opposite weakness, but that method that very many people using that for keep ea still longer profit..


tutisanyi,

wah..

like this:



it's can profit too in september.. open untill 5 times, almost lose.. hehe..

ok, u can learn that code one by one and..... prepared to be rich....

the next explanation of coding, by master zzuegg....

hehe....


int start()
{
int total=OrdersTotal(),range=20,sl=0,slippage=0;
// elso nyito pozicio
{
OrderSend(Symbol(),OP_BUY,0.01,Ask,0,0,Ask+range*Point,"Order Buy 1",11111,0,Blue);
}
// második nyito pozicio
{
OrderSend(Symbol(),OP_BUYLIMIT,0.02,Ask-0.20,slippage,0,Ask+range*Point,"2 Lot Buy",11111,0,Blue);
}
{
OrderSend(Symbol(),OP_BUYLIMIT,0.03,Ask-0.40,slippage,0,Ask+range*Point,"3 Lot Buy",11111,0,Blue);
}


// poziciok zarasa


{
if(OrdersTotal()<2) // ha kevesebb pozició van, mint az összes (azaz, ha zarodott valamenyik)
{
for(int i=3-1;i>=0;i--)
OrderSelect(i, SELECT_BY_POS);

bool result = false;

//Close opened long positions
if (OrderType() == OP_BUY ) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
//Close pending orders
if (OrderType() > 1 ) result = OrderDelete( OrderTicket() );
}
else
return(0);
}
return(0);
}

I tried to rewrite, but the end does not work.
that is what you can unlock it closes down.
I do not know why?

 
tutisanyi:


int start()
{
int total=OrdersTotal(),range=20,sl=0,slippage=0;
// elso nyito pozicio
{
OrderSend(Symbol(),OP_BUY,0.01,Ask,0,0,Ask+range*Point,"Order Buy 1",11111,0,Blue);
}
// második nyito pozicio
{
OrderSend(Symbol(),OP_BUYLIMIT,0.02,Ask-0.20,slippage,0,Ask+range*Point,"2 Lot Buy",11111,0,Blue);
}
{
OrderSend(Symbol(),OP_BUYLIMIT,0.03,Ask-0.40,slippage,0,Ask+range*Point,"3 Lot Buy",11111,0,Blue);
}


// poziciok zarasa


{
if(OrdersTotal()<2) // ha kevesebb pozició van, mint az összes (azaz, ha zarodott valamenyik)
{
for(int i=3-1;i>=0;i--)
OrderSelect(i, SELECT_BY_POS);

bool result = false;

//Close opened long positions
if (OrderType() == OP_BUY ) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
//Close pending orders
if (OrderType() > 1 ) result = OrderDelete( OrderTicket() );
}
else
return(0);
}
return(0);
}

I tried to rewrite, but the end does not work.
that is what you can unlock it closes down.
I do not know why?


Somebody help me, not much longer and would be ready to
 

your code error in order send and order close function,

wait .. i fix for u..

 
hardyyanto:

a kód hibát, hogy küldjön és a rend szoros funkció,

várj .. i javítás az u. .


I'm waiting
 

why do u want to using buy limit?

it bettermake direct buy when price moving opposite than our position as 20 pips, then open buy with more lots..

if u using buy limit, u must using condition. if not, can error open position..

because buy limit can happen if current price at the lower than your buy limit price

and buy stop when current price at higher than buy stop price..


and one more, if using buy pending, if the price direct jump 100 pips opposite than your open, so all your pending order that below 100 pips will be lose quickly..

so using this code more good:

int start()
{
int total=OrdersTotal(),range=20,sl=0,slippage=0;
// elso nyito pozicio
 if (total<1)
{
OrderSend(Symbol(),OP_BUY,0.1,Ask,0,0,Ask+range*Point,"Order Buy 1",11111,0,Blue);

}
OrderSelect(total-1, SELECT_BY_POS, MODE_TRADES);
         if (OrderType()==OP_BUY)
         {
         if  ((Ask+1*Point >= (OrderOpenPrice()-range*Point)) && (Ask-1*Point <= (OrderOpenPrice()-range*Point)))
            {
              
             
               OrderSend(Symbol(),OP_BUY,OrderLots()*2,Ask,slippage,0,Ask+range*Point,"Double Lot Buy",11111,0,Blue);               
               
            }
         else if ((Ask+1*Point >= (OrderOpenPrice()+range*Point)) && (Ask-1*Point <= (OrderOpenPrice()+range*Point))) closebuy();
         }
return(0);
}

void closebuy()
{
int total=OrdersTotal(),i;
for(i=total-1; i>=0; i--)
  {
     OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
     if (OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,5,CLR_NONE);
  }
   return(0);
}

and this code seems can not delete the open pending that not touch

if (OrderType() > 1 ) result = OrderDelete( OrderTicket() );

maybe can using like this:

if (total==0){
if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_BUYSTOP || OrderType()==OP_SELLSTOP
            || OrderType()==OP_BUYLIMIT || OrderType()==OP_SELLLIMIT){
               OrderDelete(OrderTicket());
}

ok, maybe like that..

sory if i wrong..

 

zzuegg, even that line make u cry, but one day, u will using it..

hehe...

 
hardyyanto:

and one more, if using buy pending, if the price direct jump 100 pips opposite than your open, so all your pending order that below 100 pips will be lose quickly..


if the price direct jump 100 pips opposite than your open, all limit & stop orders Should not be execute at all

hardyyanto:

maybe can using like this:

if (total==0){
if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_BUYSTOP || OrderType()==OP_SELLSTOP
            || OrderType()==OP_BUYLIMIT || OrderType()==OP_SELLLIMIT){
               OrderDelete(OrderTicket());
}

ok, maybe like that..

sory if i wrong..

u r wrong because if (total==0)

So there is no point to continue

if (OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_BUYSTOP || OrderType()==OP_SELLSTOP
|| OrderType()==OP_BUYLIMIT || OrderType()==OP_SELLLIMIT)

 

oh.. so the all pending order not get touch..

ohh.. because slipage..

i am forget..

hehe..