Ask! - page 22

 
billworld2:
Thanks, but, this doesn't work. First, I changed "i>=ObjectsTotal" to "i<=ObjectsTotal" (typo). Then, I noticed that you're creating another arrow object where we want to create a new text object which includes the name of the arrow object. Anyway, the code below is creating a bunch of arrows (around 50) all overlapping on the same coordinates.

Still lost on this one. If you have a chance to take another look, that would be much appreciated. To be clear, I'm looking to create one new text object which gets positioned below each existing arrow object where the text description of the text object is equal to the name of the arrow object.

Bill

I wanted just to show u the idea. I think it is so easy that when u will read all the code and understand the idea, u will make a good code.

 

But the idea which is "so easy" doesn't work. I guess if it's so easy, why not just show a correct answer rather than post something which doesn't work and claim it's "so easy"? Everything is easy once one understands how to do it.

Kalenzo:
I wanted just to show u the idea. I think it is so easy that when u will read all the code and understand the idea, u will make a good code.
 

Still looking for assistance here. Maybe this is really elementary, but, I'm not finding any good documentation to clear this up.

I understand how to count bars right to left (present to past) in ascending order and how to count bars left to right in descending order. What I don't get is how to count bars left to right in ASCENDING order. It's been mentioned to take a look at iBarsShift, but iBarsShift references the count from right to left. There's something else missing which I'm not getting.

I simply want to count bars from left to right (past to present) starting the beginning of each month.

Forgive me if this is quite elementary. And, thanks for any help.

Bill

billworld2:
Bar counting always occurs right to left (present to past) in MQL correct?

How do I achieve past to present bar counting?

For a simple example, how would I go about numbering each bar in a given month with 1 representing the first bar of the month and subsequent bars incrementing up?

Thanks for any assistance.

Bill (still caught in a loop)
 
Eaglehawk:
I haven't been on much lately because ever since I learned about interbankfx's "days off" on july 4'rth, I've been working on a safety detector, to safely exit trades, and not open new ones before the ea's stops executing (the next best thing to finding a new broker, I hope ). Just don't expect a full ea, (it's an ea setup guide in an ea file).

Creating has pushed me much futher in coding experience than i expected (or wished for ), and now i have one question that research has failed to answer. the troublemaker in question seems to me to have a fairly simple answer, but i've had no luck in finding it, so i'm not very accurate in saying it is.

Is there any way to have a function look at the current trade and see if it's profitable?

Step by step:

1) Select the current order

2) Read the order open price

3a) if order is LONG then ASK-OrderOpenPrice()

3b) if order is SHORT then OrderOpenPrice() - BID

4) If the value of previous operation is > 0 then order is proftable.

Thats all

 

that's it?

Wow! It works. Thanks! (I can't believe it was so simple )

 
Eaglehawk:
Wow! It works. Thanks! (I can't believe it was so simple )

Sometimes even so simple things, looks so hard to handle :):)

 

I was curious if anyone knew what code I would need to insert into the RSX indicator to make the RSX line change colors if it's above 70 or below 30.

Thanks!

 

Profit Keeping Loss Management

Hello All,

I have been trying to add to CODEGURU's Money Management system, the ability to Manage Profits and Loss...

The Idea!!

If trading with MM Lots when Account Balance reaches a specified percentage I would like MM Lots to be reduced significantly so that Profits Gain will not be Lost, because you are not trading with the regular MM Lots

Look at what i am done but not sure if this will work

double lotMM = MathCeil(AccountFreeMargin() * Risk / 1000) / 100;

if(AccountIsMicro==false) //normal account

{

if(lotMM < 0.1) lotMM = Lots;

if(AccountBalance()>=ProfitFactor) lotMM = 0.2;

if((lotMM > 0.5) && (lotMM < 1)) lotMM = 0.5;

if(lotMM > 1.0) lotMM = MathCeil(lotMM);

if(lotMM > 100) lotMM = 100;

}

Anyone Please help with this... CODEGURU your input will be greatly welcome

 

Can you use reverse colors?

Can I use a reverse color in ObjectSetText say red on yellow background?

 

weekly stop/target

I am trying to add a weekly stop/target to my EA. Here is what I am trying to do...starting on Sunday begin calculating profits/loss's for the week, once a certain level is reached trading will be stopped until Fridays Close/sundays open, then the P&L will be reset.

Also if the EA is started in the middle of the week it will need to know the P&L since Sunday.

Reason: