Hmm I wonder too :-D
*edit - what is the value of pairs?
if(OrdersTotal() < pairs) {
tradeCount = 1;
Going forward use SRC feature to post code. Use print statement inside if loop. Use like below:
if(OrdersTotal() != 0 && units * GlobalVariableGet(GLOBALNAME+Symbol()+Period()+"_"+symb[i])< 0) { tradeCount = 0; CloseOrder(symb[i], units); GlobalVariableSet(GLOBALNAME+Symbol()+Period()+"_"+symb[i], 0); Print("Inside first IF. tradeCount: ",tradeCount); continue; } if(OrdersTotal() < pairs) { tradeCount = 1; CreateOrder(symb[i], units); GlobalVariableSet(GLOBALNAME+Symbol()+Period()+"_"+symb[i], units); Print("Inside second IF. tradeCount: ",tradeCount); }
pairs = 2
thanks for the comment guys!!
ShinjiOno:
Code as above, I managed to close trade, however how come my tradeCount always = 1?
Is this . . . .
units * GlobalVariableGet(GLOBALNAME+Symbol()+Period()+"_"+symb[i])
. . ever negative ?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Print("tradeCount ",tradeCount);
Code as above, I managed to close trade, however how come my tradeCount always = 1?