Cycle Operator 'for' questions - page 6

 

Simon,

If you need to write it down then write it down,

I prefer not to use this method. I believe it to be unnecessary and even cumbersome. The thought of writing the coding task on paper should be removed from thought and replaced with the division of coding a task into sections so as to be organized in my mind to not be overwhelmed by the entire task as a whole. I wish to merely visualize it in my mind, section by section, then code it, section by section in MetaEditor. There have been nightmare projects I thought nearly impossible to complete because the code was so overwhelming. ;) Experience taught (and continues to teach) me this lesson. Your advice is well received and I am grateful for it.

Thank you.

 

Simon,

Why is the  -1 there . . . .

I still do not know why -1 is there but ;) I will make an educated guess.

We have discussed the value zero of OrderSelect() function's first parameter within this post.

We discussed how arrays hold a similar representation to values as the OrderSelct() function's first parameter.

In more detail of the last statement we discussed the values of an array: 0,1,2,3,etc.

I do believe I understand why many programs begin loops at -1. I believe this is to ensure a value is not skipped, in more particular, value zero (0), correct?

No offense has been taken. :)

Thank you.

 
WhooDoo22:

Simon,

If you need to write it down then write it down,

I prefer not to use this method. I believe it to be unnecessary and even cumbersome. 

Well you are very, very wrong.  If you can't write it down then how do you expect to be able to code it ?   so now you will say "I can write it down but I choose not to"  if you ever learn coding of any sort formally you will be taught to first construct a flow chart . . . i.e.  write it down,  in doing so you will find potential problems with your reasoning and be able to fix them before committing yourself to code.  Cumbersome ? no,  efficient.
 
WhooDoo22:

Simon,

Why is the  -1 there . . . .

I still do not know why -1 is there but ;) I will make an educated guess.

Not an educated guess,  just a guess and not a good one . . .

 

What does OrdersTotal() give us ? 

 

Simon,

What does OrdersTotal() give us ?

According to the MetaEditor dictionary, the OrdersTotal() function Returns market and pending orders count.

Thank you.

 

Simon,

If you can't write it down then how do you expect to be able to code it ?

I'll gladly write code in string or flow chart format if kindly asked to do so. I can also code it directly because I understand code format by reading the MetaEditor dictionary.

I do not frown on learning flow charts or writing code in string format. I acknowledge its practical aspect but do not see it to be considered a requirement, unless ;) there is a particular reason for doing so.

thank you.

 
WhooDoo22:

Simon,

What does OrdersTotal() give us ?

According to the MetaEditor dictionary, the OrdersTotal() function Returns market and pending orders count.

Thank you.

So if OrdersTotal() returns 10  what is the last and first order position ?
 
RaptorUK: So if OrdersTotal() returns 10  what is the last and first order position ?

Woo, me, me, right-hand high above my head. :)))

@WhooDoo22. Understanding the answer to RaptorUK's question above is the solution to 90% of the the problem you've been struggling with for the last couple of weeks.

As an additional note, the order Position cannot be used as Order-Ticket-Number. Ticket# will never be Zero, not even within the back-tester where you feel like you know the sequence.

I wrote some De-bugging tips for Ernest which I think you could benefit from. Here.

 

ubzen,

the order Position cannot be used as Order-Ticket-Number.

This is my understanding, I can use Order ticket position or Order ticket number as a second parameter of the OrderSelect() function. This is all that matters.

I believe what you meant to write is: The Order ticket position is not considered the Order ticket number. Please clarify if you wish to.



Ticket# will never be Zero

I am assuming by Ticket#, you are referring to Order ticket number. Am I right?


Currently I am dealing with Order ticket position and not Order ticket number yet your post is welcomed and appreciated.

Thank you for your post and De-bugging tips. Both are welcomed and appreciated.

Thank you.

 
WhooDoo22:

Currently I am dealing with Order ticket position and not Order ticket number yet your post is welcomed and appreciated.

Thank you for your post and De-bugging tips. Both are appreciated.

An Order has a ticket number,  an Order also has a position in the Order pool . . .  so the options are Order position or Ticket number

How about an answer to my question above . . . .  "So if OrdersTotal() returns 10  what is the last and first order position ?"

Reason: