Rahul Mohindar Oscillator - page 11

 
Jozy:

Mr Mladen, you are probably right, as always. And your input is much appreciated.

Going forward, any chance then of an exit ea based on the indicator? Best if this ea could have a multi time feature so that it can work based on a different time frame to what it is attached to.

The disadvantage is that I don't think then I can optimise it as part of a system of moving averages and various entry point options. What do you think?

Jozy

All that needs to be done is a call to iCustom() and to appropriate buffer to get the value that you need in your EA (depending on the criteria that you chose).

Nothing have changed regarding that and the usage of custom indicators (after all, according to "statement" from eabuilder people, ex4 file could not be used from an EA and nothing is further from the truth since all the ex4 files - with a very few examples that were using functions that depended on physical storage or low level API calls - all the old ex4 files can still be used exactly the same as before from the EAs)

 
mladen:

Jozy

All that needs to be done is a call to iCustom() and to appropriate buffer to get the value that you need in your EA (depending on the criteria that you chose).

Nothing have changed regarding that and the usage of custom indicators (after all, according to "statement" from eabuilder people, ex4 file could not be used from an EA and nothing is further from the truth since all the ex4 files - with a very few examples that were using functions that depended on physical storage or low level API calls - all the old ex4 files can still be used exactly the same as before from the EAs)

Mladen, thank you very much. Now got to work out what you mean!

Back to my tutorials.

 
mladen:

Jozy

All that needs to be done is a call to iCustom() and to appropriate buffer to get the value that you need in your EA (depending on the criteria that you chose).

Nothing have changed regarding that and the usage of custom indicators (after all, according to "statement" from eabuilder people, ex4 file could not be used from an EA and nothing is further from the truth since all the ex4 files - with a very few examples that were using functions that depended on physical storage or low level API calls - all the old ex4 files can still be used exactly the same as before from the EAs)

Mr Mladen, I have looked and failed to implement what you suggest above. Any help with tuition - how and what to change by showing me where in the code things got to change. I will be most grateful. Thanks

 
Jozy:
Mr Mladen, I have looked and failed to implement what you suggest above. Any help with tuition - how and what to change by showing me where in the code things got to change. I will be most grateful. Thanks

Jozy

Please post the code that you are using for iCustom() calls so that it can be checked

 
mladen:

Jozy

Please post the code that you are using for iCustom() calls so that it can be checked

Thank you Mladen, here is the EA idea I am trying to make.

All help is much appreciated

Files:
 
Jozy:

Thank you Mladen, here is the EA idea I am trying to make.

All help is much appreciated

Jozy

Second parameter in the iCustom() call can not be 10 (there is no price 10)

Change that to some existing price constant, and all will work OK

 

Your iCustom() calling block should look like this :

if(Cross(1, iCustom(NULL, PERIOD_H1, "exit swing smoother rsi 2", 13, 0, 10 , 3, 0, 1) < 75)) //exit swing smoother rsi 2 crosses below fixed value )

{

if(IsTradeAllowed())

myOrderClose(OP_BUY, 100, "");

else //not autotrading => only send alert

myAlert("order", "");

}

//Close Short Positions, instant signal is tested first

if(Cross(0, iCustom(NULL, PERIOD_H1, "exit swing smoother rsi 2", 13, 0, 10, 3, 0, 1) > 25)) //exit swing smoother rsi 2 crosses above fixed value )

{

if(IsTradeAllowed())

myOrderClose(OP_SELL, 100, "");

else //not autotrading => only send alert

myAlert("order", "");

}
 
mladen:
Your iCustom() calling block should look like this :

if(Cross(1, iCustom(NULL, PERIOD_H1, "exit swing smoother rsi 2", 13, 0, 10 , 3, 0, 1) < 75)) //exit swing smoother rsi 2 crosses below fixed value )

{

if(IsTradeAllowed())

myOrderClose(OP_BUY, 100, "");

else //not autotrading => only send alert

myAlert("order", "");

}

//Close Short Positions, instant signal is tested first

if(Cross(0, iCustom(NULL, PERIOD_H1, "exit swing smoother rsi 2", 13, 0, 10, 3, 0, 1) > 25)) //exit swing smoother rsi 2 crosses above fixed value )

{

if(IsTradeAllowed())

myOrderClose(OP_SELL, 100, "");

else //not autotrading => only send alert

myAlert("order", "");

}

Hi Mladen, I replaced the 10 in the price parameter with 0 didn't work, I tried with 1 din't work. Same error log., this is the resulting EA and test error result. Something still not quite right.

Thank you for your assistance

 
Jozy:

Hi Mladen, I replaced the 10 in the price parameter with 0 didn't work, I tried with 1 din't work. Same error log., this is the resulting EA and test error result. Something still not quite right.

Thank you for your assistance

That error mean that the EA can not find the required "exit swing smoother rsi 2" indicator in the indicators folder. You need this one : exit_swing_smoother_rsi_2.mq4

Also, here is the EA that works OK reading the values from the indicator (the bloody interface replaced ">" and "<" with those letters in that code) : exit_rsi_smooth_test_2.mq4

 

I am most grateful Mr Mladen. Will update you shortly.