Noob EA question - page 2

 
RaptorUK:

You are probably correct.

int OrdersTotal( )

Returns market and pending orders count.

from here: https://docs.mql4.com/trading/OrdersTotal

If you have this EA on 5 pairs OrdersTotal will return the number of open orders for the EAs on the 5 pairs and also any that were opened by other EAs or manual trading . . . if you only ever plan to run this EA on one pair and no other EA on any pair on the same terminal then you might be OK.


Cool, thanks

I will probably leave it the way it is then, with the for statement, but good to know that I am starting to understand this.

Thanks a bunch
 
Ok, how bout this

http://paste.pound-python.org/show/11067/

I'm not getting any trades because I tried to add some more code to get an agreement between the 5min MACD and the 4hr MACD

But not it's not taking trades
I don't think I have to make changes to the open orders part it should work fine without any changes I think ?

Can I even use this to test on the strategy tester on 5min chart selected while also checking 4hr chart for MACD ?
Hmm think I need to add the symbol for the currency since I'm not testing the current time chart I likely need to add the symbol for this now I think ?

P.S
I don't care about the results just want to learn to code better
 
http://paste.pound-python.org/show/11069/

Got this now and it's taking a few trades but not really working, I'll hack some more tomorrow


Thanks
 
I'm just missing something


http://paste.pound-python.org/show/11108/

Seems like it should work to trade the 5min MACD crosses if they agree with the 4HR MACD


But I didn't use an if statement I just used if(isCrossed_1 == 1 && isCrossed_2 == 1 )

Seems like it should work.

I tried also the if(Crossed_2 == 1) on top of the if(isCrossed_1 == 1) and this produced different results but only seemed to buy ONLY never sells.

I think if I can understand how to coordinate more then one indicator together then this will be a major stepping stone for my understanding of coding MQL4

I'm thinking I need a while statement even though I don't completely understand the while statements yet, but I'll look up that route next

I'm sort of posting here for help, but also to have record of my progress and some recorded notes for myself and anyone else who may be going down this road too just FYI


Thanks


Reason: