Ask! - page 70

 

Thanks, I think I can take it from here with your coding. As they say in the South, Moucho Gracias!

Dave <<<
 

Codersguru please help me!

Hello. Perhaps you can help me.

I try to code EA with Ichimoku a Kinko Hyo.

It is to set a Buy order, if the Tenkan - sen is over the Kijun - sen.

If Tenkan<Kijun then Sell order. And whole at 20.00 o'clock.

Please help me.

Thank you.

fxbeginner

 

entry on a new bar

I am coding an option of OrderSend on the start of the next bar.

Anybody can direct/post good code on how to enter trade on a new bar?

 

not trade on Monday

Hello!

Could someone post simple code which disable Expert on Monday and start trading week only of the beginning of Tuesday?

Thanks!

luckyfx

 
european:
I am coding an option of OrderSend on the start of the next bar. Anybody can direct/post good code on how to enter trade on a new bar?

// in main program

if(NewBar()) doEnterTrade();

bool NewBar()

{

static datetime dt = 0;

if (Time[0] != dt)

{

dt = Time[0];

return(true);

}

return(false);

}

Mark

 
luckyfx:
Hello!

Could someone post simple code which disable Expert on Monday and start trading week only of the beginning of Tuesday?

Thanks!

luckyfx

#define TUESDAY 2

if(DayOfWeek() < TUESDAY) return(0);

Mark

 
flexie:
// in main program

if(NewBar()) doEnterTrade();

bool NewBar()

{

static datetime dt = 0;

if (Time[0] != dt)

{

dt = Time[0];

return(true);

}

return(false);

}

Mark

Thanks flexie,

I know how to use Time/iTime now.

euro

 
Benjimang:
Hi everyone!

I have used the Expert Advisor Builder at sufx.com to create an EA. It has two limitations that I am trying to get rid of:

1. only opens 1 trade at a time. I can get it to have two trades open at once, but I can't get it to open a buy order and a sell order simultaneously.

2. seems to take sell orders as a preference over buy orders. This wouldn't really be an issue if problem number 1 was solved.

Here is the peice of code that seems to be holding me up:

//Check position

bool IsTrade = False;

for (int i = 0; i < Total; i ++) {

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

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

IsTrade = True;

if (OrderType() == OP_BUY) {

//Close

Any suggestions? I'd like to let it open as many trades as possible, and be able to open buy and sell orders simultaneously if the indicators say so.

Cheers for the help,

Benjimang

Why is everyone ignoring me?

 
flexie:
#define TUESDAY 2

if(DayOfWeek() < TUESDAY) return(0);

Mark

To flexie:

Thanks a lot! It works fine!

 

New Question -- Simple and quick for "Pros"

Hi Coders,

I need a simple code function to look back over a certain number of bars and return the index of the bar with the greatest range (i.e. high[]-low[]) as well as the range of that bar, itself.

Any help would be appreciated,

Thanks,

SaxMan

Reason: