Requests & Ideas - page 269

 
tamaraofx:
Thanks, mladen.

I felt there was something wrong with my code/signal. I was using buffer 0 and 1 for blue and red lines. I am actually using crossover buy when blue is above/greater than red (and previous red above blue). For additional position, I used when blue is > than red and supersignal paints green then buy (vice versa for sell). It was making some trades but I knew there is something wrong. Please see the chart and give me correct signals/codes.

Thank you very much.

Paul

The code Mladen just gave is for the cross so if using that code and still getting wrong entries could be because of the repainting or recalculating of supersignal.

 
tamaraofx:
Hi mrtools,

I already have the iCustom information for the indicators. I only need the buy/sell command based on the trade conditions I mentioned earlier.

Thanks much,

Paul

PS. Please find below the code I did. I believe it's not accurate. Kindly review.

if (((jurikBlue1 > jurikRed1) && (MSS2>MSS1))

|| (jurikBlue1 > jurikRed1 && jurikBlue2 < jurikRed2)

) return(__trendUp);

if (((jurikRed1 > jurikBlue1) &&(MSS1>MSS2))

|| (jurikRed1 > jurikBlue1 && jurikRed2 < jurikBlue2)

) return(__trendDown);

Paul

Part like this : (jurikBlue1 > jurikRed1 && jurikBlue2 < jurikRed2) is OK (it is a clear signal that two values have crossed and it is OK)

But part like this : (jurikRed1 > jurikBlue1) &&(MSS1>MSS2) is too general (it can happen on a great number of bars, it is not a signal - it is more a condition that can last)

 

Hi Mladen, hope the market has been treating you well, and a merry Christmas to you. I haven't bugged you for a while, thought I bug you one more time before the year is over.

volatilityqualityzerolinecandlesalertsmtf.mq4

volatilityqualityzerolinehistoalertsmtfv2.mq4

volatilityqualityzerolinetapealertsmtf.mq4

Please see the above 3 files.

1. VQ Zeroline Histo has an averaging parameter which both the candle and tape indicator does not have. I would like for you to have the averaging parameter coded into both the candle and tape indicator. And the reason is...

2. I would like all 3 VQ indicators to have the following color changes. The color formula would be as follows:

- above 0, ascending, above average = Blue

- above 0, ascending, below average = Dark Blue

- above 0, descending, above average = Dark Blue

- above 0, descending, below average = Dark Blue

- below 0, ascending, above average = Dark Red

- below 0, ascending, below average = Dark Red

- below 0, descending, above average = Dark Red

- below 0, descending, below average = Red

3. Finally, alerts to be added when values crosses above or below averages.

Looking forward to it. Thank you Mladen!!

 
rayphua:
Hi Mladen, hope the market has been treating you well, and a merry Christmas to you. I haven't bugged you for a while, thought I bug you one more time before the year is over.

volatilityqualityzerolinecandlesalertsmtf.mq4

volatilityqualityzerolinehistoalertsmtfv2.mq4

volatilityqualityzerolinetapealertsmtf.mq4

Please see the above 3 files.

1. VQ Zeroline Histo has an averaging parameter which both the candle and tape indicator does not have. I would like for you to have the averaging parameter coded into both the candle and tape indicator. And the reason is...

2. I would like all 3 VQ indicators to have the following color changes. The color formula would be as follows:

- above 0, ascending, above average = Blue

- above 0, ascending, below average = Dark Blue

- above 0, descending, above average = Dark Blue

- above 0, descending, below average = Dark Blue

- below 0, ascending, above average = Dark Red

- below 0, ascending, below average = Dark Red

- below 0, descending, above average = Dark Red

- below 0, descending, below average = Red

3. Finally, alerts to be added when values crosses above or below averages.

Looking forward to it. Thank you Mladen!!

rayphua

If I understand correctly you wish to have 4 states (colors). Am I correct?

__________________

PS: if it is 8 conditions and making alerts on all 8 conditions would make it almost always alert (that would be a possible 16 types of alerts). I doubt that it is the intention you had in mind (even 4 states can have possible 8 types of alerts)

 
mladen:
rayphua

If I understand correctly you wish to have 4 states (colors). Am I correct?

__________________

PS: if it is 8 conditions and making alerts on all 8 conditions would make it almost always alert (that would be a possible 16 types of alerts). I doubt that it is the intention you had in mind (even 4 states can have possible 8 types of alerts)

Dear Mladen, yes, 4 state colors would be good enough. That means the following.

State 1

- above 0, ascending, above average = Blue

State 2

- above 0, ascending, below average = Dark Blue

- above 0, descending, above average = Dark Blue

- above 0, descending, below average = Dark Blue

State 3

- below 0, ascending, above average = Dark Red

- below 0, ascending, below average = Dark Red

- below 0, descending, above average = Dark Red

State 4

- below 0, descending, below average = Red

With alerts, the same for all 3 indicators, thanks Mladen!!!!!!!

 

Hi Mladen,

Can you please take a look at the attached order management EA I coded to manage orders placed with a script ? It is supposed to work this way: you input the number of pips for stop loss, take profit, and trailing stop. If your order hit stop loss, it will close the order. If your order is in profit and above take profit level, it will close the 1st half in profit and move stop loss to break even and trail the 2nd half.

The problem is, it doesn’t work properly when you input pips for trailing stop as 0. If you input trailing stop pips as 0, it is supposed to close the 1st half in profit, then immediately close the 2nd half. However, actually it doesn’t work the way it’s supposed to. I placed an order for AUDCHF of 0.38 lots. When the order hit profit target, it closed 1st half, which was 0.19 lots. Then it was supposed to close the remaining 0.19 lots immediately. However, it did something different. It closed only 0.09 lots. Then it closed 0.05 lots, and then 0.02, 0.01, 0.01, and 0.001 lots. Please find attached the transaction history and journal message.

Can you please fix it for me ?

By the way, I have a question about global variable. How many global variables are we allowed to use in MT4 ?

Thank you in advance,

pooh

 
pooh123:
Hi Mladen,

Can you please take a look at the attached order management EA I coded to manage orders placed with a script ? It is supposed to work this way: you input the number of pips for stop loss, take profit, and trailing stop. If your order hit stop loss, it will close the order. If your order is in profit and above take profit level, it will close the 1st half in profit and move stop loss to break even and trail the 2nd half.

The problem is, it doesn’t work properly when you input pips for trailing stop as 0. If you input trailing stop pips as 0, it is supposed to close the 1st half in profit, then immediately close the 2nd half. However, actually it doesn’t work the way it’s supposed to. I placed an order for AUDCHF of 0.38 lots. When the order hit profit target, it closed 1st half, which was 0.19 lots. Then it was supposed to close the remaining 0.19 lots immediately. However, it did something different. It closed only 0.09 lots. Then it closed 0.05 lots, and then 0.02, 0.01, 0.01, and 0.001 lots. Please find attached the transaction history and journal message.

Can you please fix it for me ?

By the way, I have a question about global variable. How many global variables are we allowed to use in MT4 ?

Thank you in advance,

pooh

pooh

The problem is simple : how can the EA know that it already closed a half if it does not know what was the initial size of the order? If the order sizes traded are not fixed size (so that the EA exactly knows at which step the order is currently) there is no way how the EA can "know" that it has been closed partially already - comment part of the order info can not be used for that)

The only solution is that the initial order sizes are fixed sizes and only then the EA can do what you are intending to do

 
mladen:
pooh

The problem is simple : how can the EA know that it already closed a half if it does not know what was the initial size of the order? If the order sizes traded are not fixed size (so that the EA exactly knows at which step the order is currently) there is no way how the EA can "know" that it has been closed partially already - comment part of the order info can not be used for that)

The only solution is that the initial order sizes are fixed sizes and only then the EA can do what you are intending to do

Mladen,

Acutally I already factored it in and used a global variable "Gstatus" to let the EA know if it has already closed the 1st half. "Gstatus" is initially set at 1.0. If the EA closes the 1st half, it will change the value of "Gstatus" to 2.0.

However, it still doesn't work properly when the trailing stop pips is 0.

 
rayphua:
Dear Mladen, yes, 4 state colors would be good enough. That means the following.

State 1

- above 0, ascending, above average = Blue

State 2

- above 0, ascending, below average = Dark Blue

- above 0, descending, above average = Dark Blue

- above 0, descending, below average = Dark Blue

State 3

- below 0, ascending, above average = Dark Red

- below 0, ascending, below average = Dark Red

- below 0, descending, above average = Dark Red

State 4

- below 0, descending, below average = Red

With alerts, the same for all 3 indicators, thanks Mladen!!!!!!!

Mladen, would this be a 4 state color?

 
rayphua:
Mladen, would this be a 4 state color?

rayphua

Yes it would be a 4 state color

Reason: