Coding help - page 484

 
xtractalpha:

Hi Mladen,

Thanks for your response.

The lastorderprofit function isn't needed because my lastTradeTicket() function does the same job.

Could you please give a look at my EA?

I'm not asking you to edit the code, but I would be very thankful if you could tell me what I coded wrong.

Thanks in advance,

Thierry

53_martingale.mq4

xtractalpha

You are not checking the time of the closed order (usually it should be the closing time of the order) so the lastTradeTicket() does not necessarily return the ticket of last order that was closed (according to metatrader the list of closed orders is not ordered in any particular order - they do not guarantee tat it will be in ascending or descending order of tickets - and it never is ordered by time - that is not a priority for closed orders list at all).

If you add time check, it should work OK

 
mladen:
xtractalpha

You are not checking the time of the closed order (usually it should be the closing time of the order) so the lastTradeTicket() does not necessarily return the ticket of last order that was closed (according to metatrader the list of closed orders is not ordered in any particular order - they do not guarantee tat it will be in ascending or descending order of tickets - and it never is ordered by time - that is not a priority for closed orders list at all).

If you add time check, it should work OK

Thanks Mladen,

I've edited your lasttrade function into my EA.

Unfortunately, the EA is making trades, but the lotsizing doesn't make sense. (link: Screenshot by Lightshot )

I feel really stupid right now, because normally I'm able to edit code by myself, but this time everything goes wrong.

Thanks

Files:
 

Hi malden. I seem to remember, from the far distant past, that you are not a fan of PM's.

Can I push my luck and ask permission to send you one? I have an idea for an expert I would like to throw at you.

 
xtractalpha:
Thanks Mladen,

I've edited your lasttrade function into my EA.

Unfortunately, the EA is making trades, but the lotsizing doesn't make sense. (link: Screenshot by Lightshot )

I feel really stupid right now, because normally I'm able to edit code by myself, but this time everything goes wrong.

Thanks

xtractalpha

Will have to test it to see what is happening. If I find what is the problem, will post it here

 

Could this indicator be made to work on indices please? It works well on FX charts.

Thanks

TEAMTRADER

Files:
 
TEAMTRADER:
Could this indicator be made to work on indices please? It works well on FX charts.

Thanks

TEAMTRADER

Change the MaxValue parameter to, let say, 20.000 (20 thousands). It will work. You have to adjust the max value for objects on charts to some expected maximal value.

___________________

Or use this one : dema_macd_zones_1.mq4. It does that automatically

Files:
 

Thanks for you great skill Mladan.

i am not programmer but your skill helps me as well as ALL

i have tried to add this code

double previousDayClose = iClose(symbol,PERIOD_D1,1);

but i m unsuccessful to do this, and its still freezes when i use rsi Color for live quotes without color its work finehttps://www.forex-tsd.com/metatrader-4/2432-coding-help-482.html#post746575regards

 

Hi.

In some MTF timeframe indicators I saw that one option was use next timeframe. How can I add this?

 
NWFstudent:
Hi. In some MTF timeframe indicators I saw that one option was use next timeframe. How can I add this?

I am afraid I do not understand?

Would you midnd explaining more?

 

Let say you are trading the 1hour chart and you use a mtf indicator displaying the 4hr chart, then i want the setting to be use next time frame.

ie. i am trading the 1hr chart and the indicator are using 4hr data, when i swap my time frame to 4hr i want the indicator to swap to the timeframe above 4hr, so now it will use the daily data.

I found this thread, but as im no coder im not sure where to paste to code or if it needs any modification for the actual indicator.

Next Timeframe - MQL4 forum

The indicator I want to add this to is "Traders Dynamic_Cb_ssa norm Index_alerts+arrows new 1.01" from the elite forums