How to code? - page 126

 
IN10TION:
:: did use some more keys for this one... but u can use it for other currencies also, was only set for EURUSD... don't know why, you will know better I hope

Hi

This Ea need forex_Nn_Ind_juna.ex4 indicator, i need this indicator have you it?

 

I please need Price(Close) crossing EMA Indicator with Alert

I am in need of an indicator with alert

It should be in seperate indicator window and have sound alert

I need it in histogram that changes colour

barlength=EMA(externalparameter)-close

if barlengthnow<barlengthprevious then bar is red

if barlengthnow>barlengthprevious then bar is green

if barlengthnow=barlengthprevious then bar is yellow

see example of bars below in pic

must offer sound alert if external parameter is set when bar change from red to green or fromgreen to red and also when bar is crossing zero line

Can anyone please help?

Thanks

PipSqweez

 

Change Open Bar Time

Hello,

My current EA generates buys/sells based off the daily time frame of an indicator. This causes trades to be opened at 00:00 when the correct conditions are met. How can I change the starting time of the daily time frame? For example, right now the daily bar opens at 00:00 and closes at 24:00. I need to make the bar opens at a different time, say 02:00, not 00:00.

Any help would be greatly appreciated! My main goal is to spread out my trades throughout the day so im not always buying/selling at the same time. This would allow for more trades : )

 

hello guys

I have a question here... how do I change the following;

extern double MaxLot = 1.50;

double max_lot = GetMaxLot(OP_BUY, OP_SELL);

if (max_lot >= MaxLot) lot = CalcHedgeLot(order_type);

(order_type)]: ", lot);

if (lot == -1) return (lot);

lot = NormalizeDouble(lot, LotPrec);

if (lot > MaxLot) lot = MaxLot;

if (lot < MinLot) lot = MinLot;

return (lot);

}double max_lot = GetMaxLot(OP_BUY, OP_SELL);

if (max_lot >= MaxLot) lot = CalcHedgeLot(order_type);

the above check for OP_BUY AND OP_SELL

question: how do I change it to any OP_BUY OR any OP_SELL

appreciate

 

Help a beginner?

Been trying to add the following parameters to this EA, but am having problems getting it to work. Can someone help code it, or atleast show me how to code it. Any help would be appreciated.

Take Profit

Stop Loss

Trailing Stop

Max Concurrent trades

Thanks!

//---- input parameters

extern double Lots=0.1;

extern int Slippage=5;

int MagicNum = 98760;

bool longPosOpened, shortPosOpened;

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

//| expert initialization function |

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

int init()

{

//----

//----

return(0);

}

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

//| expert deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| expert start function |

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

int start()

{

double crossup = iCustom(NULL , 0, "18_28Cross", 1,18,1,28,1,0, 1);

double crossdown = iCustom(NULL , 0, "18_28Cross", 1,18,1,28,1,1,1);

if (crossup != EMPTY_VALUE)

{

if (!PosOpened(OP_BUY))

{

CloseAllOpenAndPendingTrades();

OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,Symbol(),MagicNum,0);

}

}

else if(crossdown != EMPTY_VALUE)

{

if (!PosOpened(OP_SELL))

{

CloseAllOpenAndPendingTrades();

OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,Symbol(),MagicNum,0);

}

}

return(0);

}

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

bool PosOpened(int orderType)

{

int total=OrdersTotal();

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

{

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

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

{

return(true);

}

}

return(false);

}

void CloseAllOpenAndPendingTrades()

{

int total = OrdersTotal();

for(int i=total-1;i>=0;i--)

{

OrderSelect(i, SELECT_BY_POS);

if(Symbol() != OrderSymbol()) continue; // important! only close positions of current currency pair

int type = OrderType();

bool result = false;

switch(type)

{

//Close opened long positions

case OP_BUY : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 200);

break;

//Close opened short positions

case OP_SELL : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 200);

break;

//Close pending orders

case OP_BUYLIMIT :

case OP_BUYSTOP :

case OP_SELLLIMIT :

case OP_SELLSTOP : result = OrderDelete( OrderTicket() );

}

}

return(0);

}

 

*bump* for my previous post on page 125. I just saw that I didnt put the parameters I wanted on there. They are there now, so if anyone can help I'd appreciate it!!

 

Need favor from a coder..ryanklefas??

I have no idea how to write code, I just need a couple more imputs and an extra indicator added to the united ea (attached)

Added imputs:

more entry options:

1. Enter on fresh signal: true or false, if true a trade would only happen at a fresh signal not in the middle or at the end

2. option to pick what indicator I want entry on

3. Lock in Pip amount

4. option of trailing stop to begin at x number of pips in profit

One more indicator added to for confirmation as well as entry and exit options:

HMA indicator ( attached)

Thanks in advance for coding help,

Mike

Files:
hma.ex4  5 kb
 

@dan7567 - what you ask is not possible, MT uses the current brokers time and this cannot be changed. If you have the souce-code, it is much easier to just alter the time trades are opened, rather then contemplating the impossible...

@fireslayer26 - adding sl/tp code is easy - either include SL price (assuming a BUY - 'OrderOpenPrice() - SL_Pips * Point') in the OrderSend() function or modify an already open order with OrderModify() function. Ditto for TP's. The trailing stop is slightly more complicated but there are literally hundreds of EA's freely available that implement these functions...

@forexarchitect - what you are asking makes no sense - first, the code you provide is a partial custom function, that is passing pre-defined system variables (OP_BUY, OP_SELL, the values you are interested in it appears...) to another custom function which you do not include...

@litcons - not meaning to sound fasicious but the thread title is "how to code", whereas you matter-of-factly tells us you cannot code at all and are looking for someone to code an EA for you, practically from scratch - maybe the "coders for hire" thread would prove more receptive...

 

sorry about posting at the wrong thread, I should have uploaded the indicators for review, it would have made more sense,

 

Help with #property indicators

I am trying to code an indicator to change the indicator color using a "if" conditional statement with no success.

if(PeakUp==True)

{

#property indicator_color4 Lime

}

if(PeakUp==True)

{

#property indicator_color3 CLR_NONE

}

if(PeakUp==False)

{

#property indicator_color4 CLR_NONE

}

if(PeakUp==False)

{

#property indicator_color3 Red

}

Can anybody help??

Dave

<<<

Reason: