Init is called on initial load and each time the time frame or pair is changed, EA is recompiled, or chart is refreshed. Therefor StopLose becomes 10X 100X 1000X etc.
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:
int start()
{
double pivot=iMA(NULL,1,16,0,MODE_SMMA,0,0);
int total=OrdersTotal(),i,range=20,sl=0,slippage=10;
if (total<1)
{
if (Ask>pivot) OrderSend(Symbol(),OP_BUY,0.1,Ask,0,0,Ask+range*Point,"Order Buy 1",11111,0,Blue);
if (Ask<pivot) OrderSend(Symbol(),OP_SELL,0.1,Bid,0,0,Bid-range*Point,"Order Sell 1",11111,0,Red);
}
else
{
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)))
{
if (Ask>pivot) OrderSend(Symbol(),OP_BUY,OrderLots()*2,Ask,slippage,0,Ask+range*Point,"Double Lot Buy",11111,0,Blue);
else
{
OrderSend(Symbol(),OP_SELL,0.2,Bid,slippage,0,Bid-range*Point,"Hedging",11111,0,Red);
OrderSend(Symbol(),OP_BUY,OrderLots()*2,Ask,slippage,0,Ask+range*Point,"Double Lot Buy",11111,0,Blue);
}
}
elseif ((Ask+1*Point >= (OrderOpenPrice()+range*Point)) && (Ask-1*Point <= (OrderOpenPrice()+range*Point))) closebuy();
}
if (OrderType()==OP_SELL)
{
if ((Bid+1*Point >= (OrderOpenPrice()+range*Point)) && (Bid-1*Point <= (OrderOpenPrice()+range*Point)))
{
if (Bid<pivot) OrderSend(Symbol(),OP_SELL,OrderLots()*2,Bid,slippage,0,Bid-range*Point,"Double Lot Sell",11111,0,Red);
else
{
OrderSend(Symbol(),OP_BUY,0.2,Ask,slippage,0,Ask+range*Point,"hedging",11111,0,Blue);
OrderSend(Symbol(),OP_SELL,OrderLots()*2,Bid,slippage,0,Bid-range*Point,"Double Lot Sell",11111,0,Red);
}
}
elseif ((Bid+1*Point >= (OrderOpenPrice()-range*Point)) && (Bid-1*Point <= (OrderOpenPrice()-range*Point))) closesell();
}
}
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);
}
void closesell()
{
int total=OrdersTotal(),i;
for(i=total-1; i>=0; i--)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,5,CLR_NONE);
}
return(0);
}
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....
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
hello tutisanyi and zzuegg.
do u know what the demika means?
sory, maybe i am misunderstanding what demika want..
i make that ea based of macd bar from <0 to >0, then ea open buy..
when macd previous bar >macd current bar, so position will be closed on next bar..
this bar is macd histogram, not candlestick bar..
thx..
Unfortunately, it fails
Van egy javaslatom az Ön számára, próbáld https://www.mql5.com/go?link=http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/
Unfortunately, it fails
Van egy javaslatom az Ön számára, próbáld https://www.mql5.com/go?link=http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/
Unfortunately, it fails
hello tutisanyi and zzuegg.
do u know what the demika means?
sory, maybe i am misunderstanding what demika want..
i make that ea based of macd bar from <0 to >0, then ea open buy..
when macd previous bar >macd current bar, so position will be closed on next bar..
this bar is macd histogram, not candlestick bar..
thx..
1step BUY tp=20 sl=0 lots=0.1
2step Buy Limit Ask -20 tp= 20 sl = 0 lots=0.2
3step Buy Limit Ask -40 tp= 20 sl = 0 lots=0.3
4step Buy Limit Ask -70 tp= 40 sl = 0 lots=0.4
if you delete the rest from a sealed
and restarts
HELP
oh...
tutisanyi, u want to make ea like martiangle right..
dangerous type... win little pips, but sacrifice all margin..
better using on usdjpy from 6 morning-12 afternoon... because usdjpy always zigzag..
oh ...
tutisanyi, u akar tenni, mint martiangle ea jobb ..
Veszélyes típus ... győzelem kevés maggal, hanem áldozat minden különbözetet ..
jobb kihasználása révén, az USDJPY 6-tól délelőtt 12 - délutáni ... mert USDJPY mindig cakk ..
help me to write?
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....