Requests & Ideas (MQL5 only!) - page 61

 
Comments that do not relate to this topic, have been moved to "How to start with MQL5".
 
Sorry, your post was accidentally deleted. Please write again (only now in the topic How to start with MQL5 )
How to start with MQL5
How to start with MQL5
  • 2018.12.24
  • www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
 

Forum on trading, automated trading systems and testing trading strategies

Simple Ichimoku System

Renato Takahashi, 2021.04.27 21:03

I´m reading some articles about Ichimoku Kinko Hyo and it´s amazing how it´s a complex indicator that can be used with different strategies. I´m trading using Ichimoku cloud size (Senkou Span A and Senkou Span B difference) as takeprofits and one of Senkou Span (A or B) as stoploss. Sometimes, tp are short due to cloud size but it deals a lot! As Ichimoku is a dynamic indicator, tp and sl are resizing according to it. If someone wanna trade like this and give some feedback, I´ll be glad to hear it.

 

Hello Vladimir, hello all,

From the crossing of 2 iMA codes that you made, I'm trying to set the stop loss such as:

buy position > stop loss set at the lowest of the previous last 10 candles

sell position > stop loss set at the highest of the previous 10 candles

But when I use CopyHigh and CopyLow it doesn't work.

Thanks for helping.

AD

 
Antoine Djondo :

Hello Vladimir, hello all,

From the crossing of 2 iMA codes that you made, I'm trying to set the stop loss such as:

buy position > stop loss set at the lowest of the previous last 10 candles

sell position > stop loss set at the highest of the previous 10 candles

But when I use CopyHigh and CopyLow it doesn't work.

Thanks for helping.

AD

An example of a search is in the code: Two Highest Rectangle N Bars

Two Highest Rectangle N Bars

 

Hi Vladimir,

Thank you for starting this GREAT thread. I'm learning a lot.

Can you please help to code the following idea:

OPEN BUY: Allowed time to open trade AND MACD main line is moving up above signal line.

CLOSE BUY POSITION: if one of these conditions are met -

1) TP/SL is triggered

2) There's an opposite signal

3) Parabolic SAR moves to above the bar

OPEN SELL and CLOSE SELL POSITION: the reverse of the above.

SL: 1.5 * ATR (Average True Range) - the SL level (in this case 1.5 should be parameterized)

Trailing SL: based on MA - the MA Period sould be parameterized.

TP: 3 * SL - the TP level (in this case 3 should be parameterized)

Lot size is based on the % risk level, account equity, and SL. Risk level should be parameterized.

Allowed time to open trade: parameterized allowed days and hours, so I can set which days and hours the EA is allowed to start trading.

Let me know if I miss anything. Thanks again!

 
dipnqd:

Hi Vladimir,

Thank you for starting this GREAT thread. I'm learning a lot.

Can you please help to code the following idea:

OPEN BUY: Allowed time to open trade AND MACD main line is moving up above signal line.

CLOSE BUY POSITION: if one of these conditions are met -

1) TP/SL is triggered

2) There's an opposite signal

3) Parabolic SAR moves to above the bar

OPEN SELL and CLOSE SELL POSITION: the reverse of the above.

SL: 1.5 * ATR (Average True Range) - the SL level (in this case 1.5 should be parameterized)

Trailing SL: based on MA - the MA Period sould be parameterized.

TP: 3 * SL - the TP level (in this case 3 should be parameterized)

Lot size is based on the % risk level, account equity, and SL. Risk level should be parameterized.

Allowed time to open trade: parameterized allowed days and hours, so I can set which days and hours the EA is allowed to start trading.

Let me know if I miss anything. Thanks again!

Code 'Open by iMACD Close by iSAR.mq5' version 1.000.

Signals:

  • Open BUY Signal -> MACD > Signal AND SAR < Low
  • Close BUY Signal -> MACD > Signal AND SAR > Low
  • Open SELL Signal -> MACD < Signal AND SAR > High
  • Close SELL Signal -> MACD > Signal AND SAR < Low

Signals to open a position are valid only within a specified time period (Start Hour :: Start Minute - End Hour :: End Minute)

Signals to close a position are not limited in time.

 
Thanks! I will do some tests tomorrow and let you know.
 
Vladimir Karputov:

Code 'Open by iMACD Close by iSAR.mq5' version 1.000.

Signals:

  • Open BUY Signal -> MACD > Signal AND SAR < Low
  • Close BUY Signal -> MACD > Signal AND SAR > Low
  • Open SELL Signal -> MACD < Signal AND SAR > High
  • Close SELL Signal -> MACD > Signal AND SAR < Low

Signals to open a position are valid only within a specified time period (Start Hour :: Start Minute - End Hour :: End Minute)

Signals to close a position are not limited in time.

Hi Vladimir,

I think there are criteria that I didn't make very clear, so the interpretation is different.

1) Always do processing on new bar. I think we don't need InpSignalsFrequency.

2) Open BUY signal is when the MACD main line is above the signal line at the analyzed bar and below the signal line at the previous one. the additional (SAR < low) is okay.

3) Close BUY: there's an Open SELL signal OR SAR > high.

4) Open SELL signal is when the MACD main line is below the signal line at the analyzed bar and above the signal line at the previous one AND SAR > high

5) Close SELL: there's an Open BUY signal OR SAR < low.

6) Signals to open a position are valid only within a specified DAY and TIME period (so I can set if I don't want to trade on weekends)

7) You implemented the SL and TP differently. Let's not change that for now.

Those what I can catch for now. Can you please update the EA?

Thanks!

 
dipnqd :

Hi Vladimir,

I think there are criteria that I didn't make very clear, so the interpretation is different.

1) Always do processing on new bar. I think we don't need InpSignalsFrequency.

2) Open BUY signal is when the MACD main line is above the signal line at the analyzed bar and below the signal line at the previous one. the additional (SAR < low) is okay.

3) Close BUY: there's an Open SELL signal OR SAR > high.

4) Open SELL signal is when the MACD main line is below the signal line at the analyzed bar and above the signal line at the previous one AND SAR > high

5) Close SELL: there's an Open BUY signal OR SAR < low.

6)  Signals to open a position are valid only within a specified DAY and TIME period (so I can set if I don't want to trade on weekends)

7) You implemented the SL and TP differently. Let's not change that for now.

Those what I can catch for now. Can you please update the EA?

Thanks!

I will change the signals - but with a high degree of probability there will be fewer signals. I am not going to change Stop Loss and Take Profit - I always work with them this way and I don’t want to change my scheme of work.

Reason: