Coding help - page 268

 
litplum:
Thanks Mladen, it works a treat.

Now! I wonder if you know of the mq4 file or anything else similar to this script; TradeOpen v1.1.ex4. It's excellent for opening multiple trades at the same time, with stops, tp's etc, and works great in tandem with the Close Reverse indi. Problem is, settings have to be entered manually every time, I've looked for the mq4 file but can't find anything.

As ever, any help you can give will be greatly appreciated.

Cheers

litplum

Sorry, but from the ex4 I can not see what and how it does it

 
mladen:
That version must be compiled using the new metatrader 4 Here is a version that can be compiled using build 509 too (so it will compile OK on a new metatrader 4 as well as on the old one) : symbols_ratios_1.mq4

It works perfectly. Thanks a lot Mladen.

 
tkz883:
It works perfectly. Thanks a lot Mladen.

Dear Mladen,

In advance to the indicator, can i derive a bolinger band based on the "symbol ratio" computed?

Thanks in advance.

tkz

 
tkz883:
Dear Mladen,

In advance to the indicator, can i derive a bolinger band based on the "symbol ratio" computed?

Thanks in advance.

tkz

tkz

I am afraid I do not understand.

If you wish to have Bollinger bands applied to that indicator, you have a very simple solution : simply drag the Bollinger bands to the indicator window and chose "apply to previous indicator data" or "apply to first indicator data" and you will have a Bollinger bands applied to symbols ratio (like in the example). Is that what you had in mind?

Files:
boll.gif  66 kb
 
mladen:
tkz

I am afraid I do not understand.

If you wish to have Bollinger bands applied to that indicator, you have a very simple solution : simply drag the Bollinger bands to the indicator window and chose "apply to previous indicator data" or "apply to first indicator data" and you will have a Bollinger bands applied to symbols ratio (like in the example). Is that what you had in mind?

Yes, appreciate ur help...

Thanks Mladen

 

Hello, i'm new here and still trying to learn mql4 coding.

Currently need help in drawing this rectangle.

The problem is how can i measure the Length B to get the date at point 3 which it extends 10 times from the Length A ?

Any help will be great appreciated. Thanks

double price1=ObjectGet("Trendline",OBJPROP_PRICE1);

double price2=ObjectGet("Trendline",OBJPROP_PRICE2);

double time1=ObjectGet("Trendline",OBJPROP_TIME1);

double time2=ObjectGet("Trendline",OBJPROP_TIME2);

double time3=(Length A*10) //Not sure how to calculate this. (time1 + time2) does not work. Please help

ObjectCreate("Box", OBJ_RECTANGLE, 0, time1, price1, time3, price2);

ObjectSet("Box", OBJPROP_COLOR, BoxColor);

ObjectSet("Box", OBJPROP_BACK, FillColor);
Files:
 
cawat:

Hello, i'm new here and still trying to learn mql4 coding.

Currently need help in drawing this rectangle.

The problem is how can i measure the Length B to get the date at point 3 which it extends 10 times from the Length A ?

Any help will be great appreciated. Thanks

For periods when there are no bars missing you can use time3=time2+10*(time2-time1) (if the time 2 is the more recent time). If time 1 is the more recent time, just invert the time1 and time 2 in that calculation

 
mladen:
For periods when there are no bars missing you can use time3=time2+10*(time2-time1) (if the time 2 is the more recent time). If time 1 is the more recent time, just invert the time1 and time 2 in that calculation

Thanks mladen, you're always helpful.

 
cawat:

Hello, i'm new here and still trying to learn mql4 coding.

Currently need help in drawing this rectangle.

The problem is how can i measure the Length B to get the date at point 3 which it extends 10 times from the Length A ?

Any help will be great appreciated. Thanks

1 more question, how do i count the bar from time2 to time1 ? As i know iBarshift only can start counting from just only one specific date.

 
cawat:
1 more question, how do i count the bar from time2 to time1 ? As i know iBarshift only can start counting from just only one specific date.

Try like this :

iBarShift(NULL,0,time2)-iBarShift(NULL,0,time1);

Reason: