Kurka Trader - GREEDY BS

 

BS stands for Bollinger bands and Stochcastic...

Check out these results..

 

Here you go

Files:
greedy_bs.gif  8 kb
greedy_bs.htm  41 kb
 

It is a play on my first GREED EA using BB and Zero Lag Stochs. Buys when Ask price is at a temporary low. . .

Need help with a BB trailing stop... in the EA I use 3 BB's @ 1,2,3 std dev...

What I want to do is use the BB levels to set the stoploss and tighten the trailing stop.

example...

For an OP_BUY position...

If (Bid > BOLLUPPER1) {

OrderModify(StopLoss BOLLUPPER3) Trailing stop = 10

If (Bid > BOLLUPPER2) {

OrderModify(StopLoss BOLLUPPER3) Trailing stop = 5

If (Bid > BOLLUPPER3) {

OrderModify(StopLoss BOLLUPPER3) Trailing stop = 2

Also since there is Multiple open positions;

How do you select all OP_BUY positions and close them at the same time or modify them with the same stoploss?

Thanks for your help.... I am starting to think outside the indicator box and am achieving far better results, Buy LOW sell HIGH

 

that last post doesent make much sense

here is the fix

If (Bid > BOLLUPPER1) {

OrderModify(StopLoss = BOLLUPPER1 ) {Trailing stop = 10}

If (Bid > BOLLUPPER2) {

OrderModify(StopLoss = BOLLUPPER2) {Trailing stop = 5}

If (Bid > BOLLUPPER3) {

OrderModify(StopLoss = BOLLUPPER3) {Trailing stop = 2}

doesent make much sense either but should get the point across....

What i am trying to do is.

When the Bid crosses the BB upper band.

that value becomes the stoploss and

the trailing stop tightens.

Hopefully that helps

 

Kurka,

Looks great .. is it fwd test?

How do you plan to manage risk .. hedging?

regards,

auto

 
auto:
Kurka,

Looks great .. is it fwd test?

How do you plan to manage risk .. hedging?

regards,

auto

if I could only code hedging .... anyone here know how?

 

I haven't had good results on any version I have tested. They always blow an account after some time. Can you please post the EA and the settings as well?

 

Backtesting with some fixes

I added the shorts and fixed some of the math.... Looks good bur neest trailing stop logic.

Files:
 

forward test

hi, kurka

can you post Ea, i like your method, and I would to test it.

thank you

giapel

 
Kurka Fund:
How do you select all OP_BUY positions and close them at the same time or modify them with the same stoploss?

Don't know if this can help, but here's the code to close all, for example at 5:10pm. The trick is to use for(int z=close_all-1;z>=0;z--) not z++ so that it starts with the last order not the first, and works backwards.

/////////////////////////////

// Close all at 5:10 pm //

////////////////////////////

int close_all = OrdersTotal();

for(int z=close_all-1;z>=0;z--)

{

OrderSelect(z, SELECT_BY_POS);

if (Hour()==17 && Minute()==10) // or whatever condition you specify

{

if (OrderType()==OP_BUY)

{

OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, DarkGoldenrod );

}

if (OrderType()==OP_SELL)

{

OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, DarkGoldenrod );

}

}

}

 

... and here's a working stoploss code if it's useful for anybody. Define Trail.Pips at the beginning (for example 15) and Use.Trail is a Bool

///////////////////////////

// Stop Loss Management //

///////////////////////////

total=OrdersTotal();

for(cnt=0;cnt<total;cnt++)

{

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

if (OrderMagicNumber()==7500 && Use.Trail)

{

if(OrderSymbol()==Symbol() && OrderType()==OP_BUY)

{

if((Ask-OrderOpenPrice()) > (Trail.Pips * Point))

{

if(OrderStopLoss() < (Ask-Trail.Pips * Point))

{

OrderModify(OrderTicket(),OrderOpenPrice(),Ask-Trail.Pips * Point,OrderTakeProfit(),0,Cyan);

return(0);

} // close for if(OrderStopLoss() < (Ask - TrailingStop * Point))

} // close for if(Ask-OrderOpenPrice() > (TrailingStop * Point))

} // close for if(OrderSymbol()==Symbol() && OrderType()==OP_BUY)

if(OrderSymbol()==Symbol() && OrderType()==OP_SELL)

{

if((OrderOpenPrice()-Bid) > (Trail.Pips * Point))

{

if(OrderStopLoss() > (Bid+Trail.Pips * Point))

{

OrderModify(OrderTicket(),OrderOpenPrice(),Bid+Trail.Pips * Point,OrderTakeProfit(),0,Cyan);

return(0);

} // magic

} // close for if(OrderStopLoss() > (Bid + TrailingStop * Point))

} // close for if(OrderOpenPrice() - Bid > (TrailingStop * Point))

} // close for if(OrderSymbol()==Symbol() && OrderType()==OP_SELL)

} // close for for(cnt=0;cnt<total;cnt++)

Reason: