How to code? - page 259

 
star821:
I think you can find this famous ea call DTS-1, If you have sufficient money to open 50 to 200 lots. it can earn a lot money.

Hello,

where can i find this famous EA called DTS-1?

Greetings,

halobungie

 

Mladen

Hi Mladen

I have tried your STC EA. 5min enter point very good, when 30min stc on going up or down. but when 30min STC end of trend , will turn down or up. then we will buy at top, sell at bottom. stop loss point will far away enter point

So I think to use 30min or 60min bar up and down to determine trend, and still use 5min STC to enter. may improve stop loss point near enter point.

Pls refer to attached picture. use Bill Willians Fractals rule.

1. up bar: highter high and highter low.

2. down bar: lower high and lower low.

3. inside bar: follow previous bar.

4. outside bar:may consider to change direction.

Can someone to help use this rule to modify MTF FRACTAL indicator.

Thank you.

mladen:
star821

Try this one out

________________________

Some explanations : I did not use the ones you posted but made these (indicator attached in your post has my name in it, but that version is not made by me, but that is not the only reason I did not use that indicator). The indicator attached here is optimized for this EA and identifies the up or the down trend of the Schaff trend as it should be. The EA is a simple one but as it is it can be set up for ecn brokers, no hedging and automatically recognizes 5 digit brokers. Default parameters are set as you asked for.

Did not test it as of results (I only slightly tested it to see if it works as it should as far a orders and orders closing i concerned, as of results I leave you the testing and optimizing phase )

regards

Mladen
Files:
 

code missing ?

is this code complete, if so how do I compile it ?

or

if it's missing code, any idea what's missing, and if so, would you provide the missing bit/s please

#property indicator_chart_window

#property indicator_buffers 1

#property indicator_color1 DodgerBlue

double dMarker[];

extern int MarkedBar = 50;

int init() {

SetIndexBuffer(0,dMarker);

SetIndexStyle (0,DRAW_ARROW);

SetIndexArrow (0,242);

}

int start() {

for (int i=Bars-1;i>=0;i--) {

if(i == MarkedBar)

dMarker = High;

else

dMarker = EMPTY_VALUE;

}

return(0);

}

 

Need help with Programming of an EA

Hey,

I'd like to set up my first EA but have some trouble with the programming. Somehow it doesn't buy and sell the orders. I'd really appreciate the help. Please, contact me via PM.

Regards

P

 
 

Can someone fix this for me?

I have this EA, I used it with some success , stopped when IBFX changed to market order, it stopped working, been doing it manually, but it would be cool if someone could get this to work again bearish_martingale.mq4

Files:
 

modfiying ea for the point

Hi,

I have an ea where my I am trying to trail my stoploss for various breakeven pips depending on broker platform type. I am using this for 5 digit broker but I have a platform that has a 2 4 digit broker types,,, When I attempt to modify the trade my stoploss only moves to breakeven on the 2 digit brokers ( ie audyen is 88.00 for example) and not adding the profit pips and my trade closes. My question is, when I see a 2 digit broker or 4 or 5...How do I know how to determine how to get the point function to work properly?

extern bool BreakEven = true;

extern int BreakEvenPips = 37;

extern int BreakEvenProfitPips = 10;

double Pnt;

//+------------------------------------------------------------------

int init()

{

if(Digits == 5 || (Digits == 3 )) {

Pnt = Point*10;

}

if(Digits == 6 || (Digits == 4 )) {

Pnt = Point*100;

}

return(0);

}

int deinit()

{

return(0);

}

void TrailOrder(int type)

{

for(int i=0;i<OrdersTotal();i++)

{

if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) continue;

if(OrderMagicNumber()!=MagicNumber || OrderSymbol()!=Symbol()) continue;

if (OrderType()==OP_BUY)

{

if (Bid >= OrderOpenPrice () + (Pnt*BreakEvenPips &&BreakEven== false ))

{

OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+BreakEvenProfitPips*Point,OrderTakeProfit(),0,CLR_NONE);

}

}

if (OrderType()==OP_SELL)

{

if (Ask <= OrderOpenPrice() - (Pnt*BreakEvenPips &&BreakEven== false))

{

OrderModify(OrderTicket(),OrderOpenPrice()-BreakEvenProfitPips*Point,OrderOpenPrice(),OrderTakeProfit(),0,CLR_NONE);

}

}}

Any help is mightily appreciated!!

 

How to do this

open trade, if trade loses, add 15 trailing stop, leave trade open and open a new trade (EA only has 1 trade open at any one time) so EA is now operating with new trade only

trying something like this

TSTP = 15 * MarketInfo(OrderSymbol(), MODE_POINT);

for(x=0;x<OrdersTotal();x++){OrderSelect(x,SELECT_BY_POS,MODE_TRADES);{

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

if(totval < -10) { OrderModify(OrderTicket(), OrderOpenPrice(),Bid - TSTP, OrderTakeProfit(), Blue);

OrderClose(OrderTicket(),OrderLots(),Bid,Slip,Aqua);Magic = Magic +1;}}

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

if(totval < -10) { OrderModify(OrderTicket(), OrderOpenPrice(), Ask + TSTP, OrderTakeProfit(), Blue);

OrderClose(OrderTicket(),OrderLots(),Ask,Slip,Gold);Magic = Magic +1;}}}}

 

Ordermodify() error code 1

hi guys ,

i customize this code for myself but when i run it in strategy tester , it send this error code :

2011.04.14 02:38:22 2011.04.12 04:02 OrderModify error 1[/CODE]

and this is the code:

( i dont know what is wrong with it , help please )

[CODE]void CheckTrailingStop()

{

for(int i=0;i<OrdersTotal();i++)

{

if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;

if(OrderSymbol()!=Symbol()) continue;

if(OrderType() == OP_BUY)

{

if(((Bid - OrderOpenPrice()) > (Poin * TrailingStop)) && (OrderStopLoss() < (Bid - (Poin * TrailingStop))))

OrderModify(

OrderTicket(),

OrderOpenPrice(),

Bid - ( Poin * TrailingStop ),

OrderTakeProfit(),

0,

GreenYellow);

}

if(OrderType() == OP_SELL)

{

if(((OrderOpenPrice() - Ask) > (Poin * TrailingStop)) && (OrderStopLoss() > (Ask + (Poin * TrailingStop))))

OrderModify(

OrderTicket(),

OrderOpenPrice(),

Ask + ( Poin * TrailingStop ),

OrderTakeProfit(),

0,

Red);

}

}

}
 

Go to your libraries subdirectory in Experts and look in stdlib.mq4. All errors are listed there. Error 1 is "No Error" go figure, I cann't

Reason: