Cycle Operator 'for' questions - page 15

 

Simon,

Lets say the trading terminal currently has ten orders in its 'open' trades pool. Some of these orders have TP's and SL's because the trader decided to go "pro" and trade manually. NOW ;) He thinks to himself, hmm, I would like to pop this EA on a EURUSD chart and visualize it open and close trades. I WON'T because two questions are without answer. These questions are...

"My broker applies (FIFO regulation) to my trading account. I have an open EURUSD trade. This open EURUSD trade must close before the next placed trade on EURUSD chart. Will this EA open a EURUSD trade if there is already an order on EURUSD currency pair? Hmm, don't know." (whoodoo- what order position or ticket number must the EA find? AND What condition must be met?)

- actually scratch the first question because I can do this but below is the question I wish to ask you.

"My EA relies on the profit or loss of the previous order to open future trades. My trading terminal has no trades in trade history OR AND My trading terminal has no trades in 'open' trade pool. Whatever can I do? :)

Thank you.

 
WhooDoo22:

"My EA relies on the profit or loss of the previous order to open future trades. My trading terminal has no trades in trade history OR AND My trading terminal has no trades in 'open' trade pool. Whatever can I do? :)

Doesn't the EA rely on the profit or loss of the last order the EA placed not some random order placed manually when the account owner had too much to drink ?  what should it do if there are no previous orders,  i.e. a brand new shiny Demo account ?  what does your flowchart show in this case ?
 

Simon,

"when the account owner had too much to drink ?"

Hahahahahaha!!!

Yeah, traders like me should work 24/7 instead of 24/5 right? Haha ;)

I believe it's time for me to hit the grind and try writing flowcharts as you suggest. Run some tests in strategy tester then build and rebuild code in MetaEditor. I'll keep you posted. So funny!

Thank you.

 
WhooDoo22:

Simon,

"when the account owner had too much to drink ?"

Hahahahahaha!!!

Yeah, traders like me should work 24/7 instead of 24/5 right? Haha ;)

Yes,  work 24/7 to learn to code properly,  then another 24/7 to find a strategy that actually is profitable . .  then lie on the beach all day as your EA does the real work.
 

Simon,

I read the thread, "Can price != price ?" and solved the first issue. I need to solve the second issue and continue making progress. I am working on and off this forum to fix issue two.


I wish to "cure the disease", my 'While' cycle-

while(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true && OrderSymbol()!="EURUSD")i++;

What do you believe to be a wise course of action?


Thank you.

 
WhooDoo22:


What do you believe to be a wise course of action?

Stick to PM or stick to the Forum,  if you mix the two everyone is going to get confused . . .

 
Omitted by WhooDoo22.
 

I think your terminology is just going to confuse . . .  please use the terminology used in the Documentation . . .  it talks about Order index or Position (SELECT_BYPOS)  so if there are 10 Open or Pending orders their Positions/Indexes are 0 to 9

 
RaptorUK:

I think your terminology is just going to confuse . . .  please use the terminology used in the Documentation . . .  it talks about Order index or Position (SELECT_BYPOS)  so if there are 10 Open or Pending orders their Positions/Indexes are 0 to 9

 

 

Omitted by WhooDoo22.
 
WhooDoo22:

An active trades order pool currently has ten Open orders.

Open order position numbers:                  1,2, 3,4, 5,6, 7,8, 9,10


Nope,  this is wrong . . get rid of it.  The positions and indexes are the same thing and they are 0 to 9  . . .   there is nothing that is 1 to 10 . . .  expunge it from your brain.