How to code? - page 190

 

High and High[0]

Do

High[/CODE] and [CODE]High[0]

both reference the same candle?

 
paradiseview:
Thank you Lux !

Could please tell what I'm doing wrong in this test indicator? The result I get is a price that do not change when I change "10:00" in the code. I don't know where that price came from .

I haven't looked at it too closely but I do notice that you're mixing time frames which isn't a good idea. You're getting the shift of the right candle based on the 1HR time frame but then using that shift on the 30M timeframe.

Lux

 
necrophantom:
Hi ND and all of my friends...this is my indi..i've been using for 1 year..but one thing that make me little disturb..i have to refresh every 1 hour ...

So, i will very very appreciate if someone can make this indi auto refresh..

Removing the -1 on assigning limit might help.

 
ralph.ronnquist:
Removing the -1 on assigning limit might help.

Ok..thanks ralph...let's see

 

opening a position

Position opening question for programming..

ALL I want is code for opening a single position ONE Time when conditions are true for entering. And NOT open any more positions in that direction.

Example

1. MA's cross

2. a BUY order is sent

3. CONFIRM Buy is opened (with magic number)

4. Don't open ANYMORE buys, even if above buy hits TP.

5. Do opposite when MA's cross in opposite direction.

I've tried my best to code something to do the above but I get NO positions when there should be one, then i get 1 sometimes, then I get 4 Sometimes.

So my code is Krap obviously. It has to 100% consistent

I ONLY need the code for opening, confirming **1** position only and not opening more

 

Pure Stop & Reverse EA

Sorry to digress a little guys. Pls, can any in-house programmer code an EA that operates purely based on a stop and reverse strategy? I'm willing to pay. Please PM me for more details if interested.

Thanks so much. I've been contacted.

 

How can I change postion of

How can I change postion of comments?

I have a EA that displays the comments on the top left hand side of window. I would like to to know how I can change it to the right hand side just under the EA name.

Thanks in advance

Basza

 

Hi,

I need help here. How can I code so an EA can't place the same order at the same price (twice or more). At one price, the can only be 1 order.

For example, if this EA has open a buy order at 1.4040, and then price wandering up and down from this price, and when there is another buy signal, it shouldn't open at the same price 1.4040 (or anywhere nearby 1.4040).

If I wanted to make a certain pip-range from this price (like 20 pips, adjustable from property panel), then this EA cannot open any more buy order between 1.4020-1.4060, but it can make another buy order at above 1.4060 or below 1.4020.

The same way, if this EA has open a sell order at 1.3850, it can only place another sell order above 1.3870 or below 1.3830.

The difficulty is that orders placed by this EA is random, I cannot use commands like highest-lowest transaction or first-last transaction. (thanks to OnTheRoad )

Currently, there are so many orders at the same price (or very nearby price).

I try to code this, but don't work.

bool GetFreeSpace(int Magic)

{

bool FS, TFS;

int total=OrdersTotal();

for (int cnt = total ; cnt >=0 ; cnt--)

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol() && ((OrderType()==OP_BUY)||(OrderType()==OP_SELL)) )

{

return(OrderOpenPrice());

}

if ( Bid(OrderOpenPrice()-(Step+Slippage)*Point) )

{TFS=false;}

else

{TFS=true;}

}

return(TFS);

 
lumanauw:
Hi,

.......

I try to code this, but don't work.

bool GetFreeSpace(int Magic)

{

bool FS, TFS;

int total=OrdersTotal();

for (int cnt = total ; cnt >=0 ; cnt--) {

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol() &&((OrderType()==OP_BUY)||(OrderType()==OP_SELL)) ) {

if ( Bid(OrderOpenPrice()-(Step+Slippage)*Point) )

{TFS=false;}

else

{TFS=true;}

}

}

return(TFS);

Try something like this (without - return(OrderOpenPrice)..)

 
basza:
How can I change postion of comments?

I have a EA that displays the comments on the top left hand side of window. I would like to to know how I can change it to the right hand side just under the EA name.

Thanks in advance

Basza

Placement of comments is fixed when using the Comments function. The only way to be able to move text/comments around the screen is to create them as objects.

Lux

Reason: