Coding help - page 174

 
jeffpark:
Hi mladen,

You will probably recall that I asked for some help with an MA cross EA last week. and of course referred improperly to the Elite section. Where can you suggest I should ask for this please. I have looked and not found an obvious answer. To refresh your memory this was the spec:

1.SMA EMA cross

2.On close of candle

3.OCO with place new order in new direction

4.Ability to adjust slippage

5.Audible signal of cross

6.Cross is not a real cross without a settable pip gap

7.If possible in-candle monitoring so if a candle is more than X times the ATR (settable number to count), an order is placed with an alarm in direction of this candle, and likewise to close an order but then not start a new one

8. preferably if an order is placed as in 7 to sound an alarm

9.Reliability of cross is paramount. In my charts - FXCM, Vantage, FX Choice - some EAs, including Universal Cross do not take trades or are too late

10. Settable SL but can leave out if not needed

11.Trailing Stop

12.SL goes to breakeven automatically after X pips profit

13. Max open trades number

14. magic number

Regards

Jeff

Jeff

Any coder will ask you the following (if he is not after your money of course) : do you have froward testing of such a system? That is the question we are asking also anybody that proposes some EA building.

If you do not have at least a couple of months of forward testing (manually traded of course) I doubt that anybody will make an EA based just on rules.

 

hello mladen,

first thank you for your help! i attached the indicator to the chart and with the current settings i have the same problem like before. i get a message on every tick. please see the attached message-box.

then i looked at the code. as i know it from you, way too professional for a beginner like me..

therefore i have to ask you (i hope it is not too stupid): you said that i can ignore the time or type. do i have to ignore one of them before it starts working correct? sorry but i am not familiar at all with those void-procedures called with variables.

Files:
aaa.jpg  60 kb
 
Marbo:
hello mladen,

first thank you for your help! i attached the indicator to the chart and with the current settings i have the same problem like before. i get a message on every tick. please see the attached message-box.

then i looked at the code. as i know it from you, way too professional for a beginner like me.. therefore i have to ask you (i hope it is not too stupid): you said that i can ignore the time or type. do i have to ignore one of them before it starts working correct? sorry but i am not familiar at all with those void-procedures called with variables.

Marbo

I sent you a PM, but you were faster : re-download the indicator again and you will not have that problem

As of ignoring some part : if you want to be alerted on opposite side change, for example, then simply remove the "time!=timeToTrack" part from this line :

if (time!=timeToTrack || type != message)

Then you will be alerted only if the type (above or bellow) is opposite from the previously alerted type

 

thank you so much, mladen! that's really great. now i can go on with my tests.. but before i exactly have to find out how you solved this case. the indicator itself is quite important for me but to understand how it is coded is also relevant.

 

Mladen,

Can you please make an Indicator with this code :

Buy = MACD (26, 13, 9, EXPONENTIAL) > MACDSIGNAL (26, 13, 9, EXPONENTIAL) AND REF (MACD (26, 13, 9, EXPONENTIAL), 1) > 0 AND REF (MACDSIGNAL (26, 13, 9, EXPONENTIAL), 1) > 0

Buy Exit = 0

Sell = MACD (26, 13, 9, EXPONENTIAL) < MACDSIGNAL (26, 13, 9, EXPONENTIAL) AND REF (MACD (26, 13, 9, EXPONENTIAL), 1) < 0 AND REF (MACDSIGNAL (26, 13, 9, EXPONENTIAL), 1) < 0

Sell Exit = 0

Buy/Sell arrows on the chart ..

Thanks a lot

 
rpasupathy:
Mladen,

Can you please make an Indicator with this code :

Buy = MACD (26, 13, 9, EXPONENTIAL) > MACDSIGNAL (26, 13, 9, EXPONENTIAL) AND REF (MACD (26, 13, 9, EXPONENTIAL), 1) > 0 AND REF (MACDSIGNAL (26, 13, 9, EXPONENTIAL), 1) > 0

Buy Exit = 0

Sell = MACD (26, 13, 9, EXPONENTIAL) < MACDSIGNAL (26, 13, 9, EXPONENTIAL) AND REF (MACD (26, 13, 9, EXPONENTIAL), 1) < 0 AND REF (MACDSIGNAL (26, 13, 9, EXPONENTIAL), 1) < 0

Sell Exit = 0

Buy/Sell arrows on the chart ..

Thanks a lot

rpasupathy

Don't know about indicators, but that is exactly how the macd sample EA from metatrader sample experts included in each metatrader works (it has 2 additional conditions, but all in all it is a macd crossing signal line type of signals)

 

Dear mladen and mrtools., could you please help me to code a indicator for following outputs with given inputs for Metatrder4

INPUTS

Yesterday`s-close

Today`s -open

Daily-Pivot

OUTPUT Required

If current price is GREATER than above Three Inputs Indicator should create text " BULLISH-GO LONG" at the top middle space with lime color.

If current price is LESS than above Three Inputs Indicator should create text " BEARISH-GO SHORT" at the top middle space with red color.

Else Indicator should create text " RANGE " at the top middle space with yellow color.

Thanks in advance.

I am from India and trade Indian Market.Your coding skills are laudble. I am very Grateful to you if could pl help me

 

Guys

I am afraid that this threads name is misunderstood

As I see it it was meant (and still is) to a be a thread where help to those that are trying to code some things is found, not a thread where people request that something is coded for them. Please keep it in the original spirit of the thread or else people that are some having problems in coding will end up with no place where they can get coding advices for their hard work and help and that would not be good for anybody

 

hi mladen,

may i ask my silly questions:

do repaint usually occur when having such code: for(int i=0;i<limit;i++) ?

but no repaint usually occur (sure none) when having such code :for(i=limit;i>=0;i--) ??

thanks for advice.

 
kenwa:
hi mladen,

may i ask my silly questions:

do repaint usually occur when having such code: for(int i=0;i<limit;i++) ?

but no repaint usually occur (sure none) when having such code :for(i=limit;i>=0;i--) ??

thanks for advice.

It is always much better to use the second form (from older to newer bar), but the loop direction is not an exclusive cause for repainting (you can use that inverted loop direction and still make a non repainting indicators). So it depends more on other parts of the code included in the loop other than the loop direction