Simple experts - page 13

 
simon_json:

Hi mladen,

1. I try to use different timeframes in simple EA and have changed PERIOD_CURRENT to TimeFrame and wrote for TimeFrame;
extern int TimeFrame = 0 //TimeFrame
And it works, if I write 60 in EA it becomes 1H in indicator. But can I do it in some other way, perhaps with enums?
I have looked here:
https://docs.mql4.com/constants/chartconstants/enum_timeframes
and tried a few combinations, but can't get it right. 

2. If I would like to combine two settings or two indicators. For example if both are in downtrend then buy, and if one changes then sell. Is it hard? Can I use two hull_trend in some way?
Is it enough to change something here in the code:

I think I found the solution to TimeFrames;
extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; // Time frame
 
simon_json:
I think I found the solution to TimeFrames;
But in Averages ribbon 2_9 buffer 6 only seem to be connected to current_period. Is it possible to use indicator TF 1H on 1M chart in strategy tester?
 
simon_json:

Hi mladen,

1. I try to use different timeframes in simple EA and have changed PERIOD_CURRENT to TimeFrame and wrote for TimeFrame;
extern int TimeFrame = 0 //TimeFrame
And it works, if I write 60 in EA it becomes 1H in indicator. But can I do it in some other way, perhaps with enums?
I have looked here:
https://docs.mql4.com/constants/chartconstants/enum_timeframes
and tried a few combinations, but can't get it right. 

2. If I would like to combine two settings or two indicators. For example if both are in downtrend then buy, and if one changes then sell. Is it hard? Can I use two hull_trend in some way?
Is it enough to change something here in the code:

By far the simplest (and, in my opinion, the best way) for different time frame usages is the following :

extern ENUM_TIMEFRAMES SomeTimeFrame=PERIOD_H1; // whatever time frame you wish

//
//
// and then use it like this
//
//


double hull_trend_current  = iCustom(NULL,SomeTimeFrame,"StepMA of rsi adaptive ema 2.8",PERIOD_CURRENT,RsiType,RsiLength,RsiPrice,Sensitivity,StepSize,Filter,FilterPeriod,FilterOn,10,BarToUse);
double hull_trend_previous = iCustom(NULL,SomeTimeFrame,"StepMA of rsi adaptive ema 2.8",PERIOD_CURRENT,RsiType,RsiLength,RsiPrice,Sensitivity,StepSize,Filter,FilterPeriod,FilterOn,10,BarToUse+1);

As of combining : simply use multiple iCustom() calls and then combine the results the way you need

 
simon_json:
But in Averages ribbon 2_9 buffer 6 only seem to be connected to current_period. Is it possible to use indicator TF 1H on 1M chart in strategy tester?
See the previous post : that way you can use any indicator in any time frame
 
mladen:
See the previous post : that way you can use any indicator in any time frame
Many thanks! 
In the simple EA, if SL or TP is hit in the same bar as the order is opened, the EA opens a new order in the same trend. Maybe it should wait until the trend changes and then open an order in the other direction?
So if sell-order is opened and SL is hit in the same bar, the EA opens a new sell-order. I think it would be better if it waited for a new signal (change in trend) and then opened a buy-order?
 
simon_json:
Many thanks! 
In the simple EA, if SL or TP is hit in the same bar as the order is opened, the EA opens a new order in the same trend. Maybe it should wait until the trend changes and then open an order in the other direction?
So if sell-order is opened and SL is hit in the same bar, the EA opens a new sell-order. I think it would be better if it waited for a new signal (change in trend) and then opened a buy-order?
OK. Will add that control too :)
 
stevenpun:

A simple ea base on step oma  .

The indicator have "time frame " and "time frame custom" , i not sure what is the different so i just skip it .

I not sure is that correct , but i have test have no problem .

if have any bug please modify your self :)


Hello,

 

I have a simple request for this EA.

Would it be possible to write the EA so that when I close a order, the EA does not open another one in the same direction until the change of direction appears. Right now if I close a order, the EA opens another order in the same direction and put me back in minus.

 

Thx.

D. 

PS.: I am testing the EA with 10 currency pairs. All are in plus. This is usually a view that I do not get so often. It's all in the settings. 

Files:
Capture.JPG  85 kb
 
mladen:
OK. Will add that control too :)
Thanks!
 
Desatar:

Hello,

 

I have a simple request for this EA.

Would it be possible to write the EA so that when I close a order, the EA does not open another one in the same direction until the change of direction appears. Right now if I close a order, the EA opens another order in the same direction and put me back in minus.

 

Thx.

D. 

PS.: I am testing the EA with 10 currency pairs. All are in plus. This is usually a view that I do not get so often. It's all in the settings. 

Did you means like the picture ? After close wait for net signal ?

Try this , see is that what you want .

Green pips :) 

Files:
 
stevenpun:

Did you means like the picture ? After close wait for net signal ?

Try this , see is that what you want .

Green pips :) 

I will try and let you know if something should'nt work.

Thx.

D.