OrdersTotal() work on 2 or more Charts by opening trades - page 3

 
Jack Buda:

I understand what you & Keith were saying now .

I noticed that my Stop Loss were incorrect. So i changed it to this:

if(OrderSelect(1000,SELECT_BY_POS,MODE_TRADES))

Is this supposed to be some kind of joke??

Are you posting ridiculous code with the intention of wasting people's time?

 
Keith Watford:

Is this supposed to be some kind of joke??

Are you posting ridiculous code with the intention of wasting people's time?

Keith, from my understanding you guys have been saying that i should change the "Loop" . I'm still learning & I'm not here to waste people's time.
 
Jack Buda:

I understand what you & Keith were saying now .

I noticed that my Stop Loss were incorrect. So i changed it to this:

1000 what if I have 3 trades no order will be selected
 
Jack Buda:
Keith, from my understanding you guys have been saying that i should change the "Loop" . I'm still learning & I'm not here to waste people's time.
OrderSelect 
Works like this 

We have 10 orders do we need to select an order on USDGBP BuyStop 
So we select an order then check if it's the trade we want

Select an order
Is OrderSymbol "USDGBP". If false Select another order
Is OrderType OP_BUYSTOP. If false Select another Order


But your code so far is 

Is Order Loop "USDGBP". If false Select order Loop again
Is Order Loop OP_BUYSTOP. If false Select order Loop again 
(Nothing will change u are selecting same order)

Then u rewrite the core 


Select order number 1000
Is Order number 1000 "USDGBP". If false Select Order number 1000  again
Is Order Loop OP_BUYSTOP. If false Select Order number 1000 again 
(Nothing will change u are selecting same order)

Hope u see that problem 

int Loop= 0

OrderSelect (1000 ~~~
And 
OrderSelect(Loop~~~~ 
It's all the same thing 
 
Jefferson Metha:
OrderSelect 
Works like this 

We have 10 orders do we need to select an order on USDGBP BuyStop 
So we select an order then check if it's the trade we want

Select an order
Is OrderSymbol "USDGBP". If false Select another order
Is OrderType OP_BUYSTOP. If false Select another Order


But your code so far is 

Is Order Loop "USDGBP". If false Select order Loop again
Is Order Loop OP_BUYSTOP. If false Select order Loop again 
(Nothing will change u are selecting same order)

Then u rewrite the core 


Select order number 1000
Is Order number 1000 "USDGBP". If false Select Order number 1000  again
Is Order Loop OP_BUYSTOP. If false Select Order number 1000 again 
(Nothing will change u are selecting same order)

Hope u see that problem 

int Loop= 0

OrderSelect (1000 ~~~
And 
OrderSelect(Loop~~~~ 
It's all the same thing 
I hear what you saying that if i add a number or Loop it's the same thing, then what should i add to make it right?
 
Jack Buda:
 what should i add to make it right?
That's the correct question. 

Good day. That's your home work 

In other words your question is 

How does OrderSelect and all functions that are dependent on OrderSelect   work. 
 
Mr Buda I advise that u read about a function, before u try to use it, and look at examples how it's used. 

a year ago I didn't know how to code, not even Hello World, was making EAs via EA builders. Then the Moderators in this forum told me it's better to study MQL and use book by Andrew R. Young. 
Or watch Jim dandy YouTube videos or sign up to his lessons 
Or if u not new to programming the Mql4 reference will be good for you. 
Or CodersGuru learn Mql4 

I'm saying this cause your questions leave a lot to be desired. 

It's best u learn more rather than code something that you think works best b4 you know it ur EA blows your account and fail to understand why, were the problem was in the coding itself. 

 
Jefferson Metha:
Mr Buda I advise that u read about a function, before u try to use it, and look at examples how it's used. 

a year ago I didn't know how to code, not even Hello World, was making EAs via EA builders. Then the Moderators in this forum told me it's better to study MQL and use book by Andrew R. Young. 
Or watch Jim dandy YouTube videos or sign up to his lessons 
Or if u not new to programming the Mql4 reference will be good for you. 
Or CodersGuru learn Mql4 

I'm saying this cause your questions leave a lot to be desired. 

It's best u learn more rather than code something that you think works best b4 you know it ur EA blows your account and fail to understand why, were the problem was in the coding itself. 

I honestly believe variations of 
Comment "hello world" ;
is THE best way to start, if you're  newish to programming. Learn about StringFind StringSubstr etc.. throw in dates, then use the date, say, with OnTick() to create a text clock on the chart, display closing/low/high price for the chart, then for other symbols, timeframes etc etc etc 



 
Jefferson Metha:
Mr Buda I advise that u read about a function, before u try to use it, and look at examples how it's used. 

a year ago I didn't know how to code, not even Hello World, was making EAs via EA builders. Then the Moderators in this forum told me it's better to study MQL and use book by Andrew R. Young. 
Or watch Jim dandy YouTube videos or sign up to his lessons 
Or if u not new to programming the Mql4 reference will be good for you. 
Or CodersGuru learn Mql4 

I'm saying this cause your questions leave a lot to be desired. 

It's best u learn more rather than code something that you think works best b4 you know it ur EA blows your account and fail to understand why, were the problem was in the coding itself. 

I've watched Jim's videos on YouTube & MQL4 Tutorial videos, I started this year (Jan 2019) to learn on how to code MQL4. I can say I've made a lot of mistakes too. What confuses me the most is that most forum's or videos use (i,SELECT_BY_POS,MODE_TRADES) meaning the "i" the int index uses for opening orders or closing orders from my understanding. When i use it i don't see any errors on the journal tab or experts tab. I'm not saying you guys are wrong either. It would be better if you show me how you would have written it then.
 
Jefferson Metha:
That's the correct question. 

Good day. That's your home work 

In other words your question is 

How does OrderSelect and all functions that are dependent on OrderSelect   work. 

This week ill be working on that

Reason: