Download MetaTrader 5

JPY issues

To add comments, please log in or register
Route206
211
Route206  

any idea why:

         prices[i][2]=OrderSend(instrument[i],OP_SELL,portie,Bid,3,0,0);
         if(prices[i][2]!=-1)
            {
            Alert("short : ",instrument[i]);
            }
            else
               {
               Alert("Error on ",instrument[i]," error_code: ",GetLastError());
               }

alsways works, except for any JPY pairs which give me error 

4107

ERR_INVALID_PRICE_PARAM

Invalid price

 

so weird and I don't know where to start looking - anything else besides JPY works fine. A broader slippage doesn't work either.

really puzzled. 

Alain Verleyen
Moderator
32022
Alain Verleyen  
Bid is only valid for the current chart symbol.
whroeder1
15326
whroeder1  
 prices[i][2]=OrderSend(instrument[i],OP_SELL,portie,Bid,3,0,0);
  1. Do not trade multiple currencies, you can't use any predefined variables, can't use the tester, must poll (not OnTick,) and usually other problems.
  2. Code it to trade the chart pair only. Look at the other's if you must.
  3. Then put it on other charts to trade the other pairs. Done.
Route206
211
Route206  

Good catch - should have known that! ;-)

I guess the below will work a lot better then! 

         prices[i][2]=OrderSend(instrument[i],OP_SELL,portie,MarketInfo(instrument[i],MODE_BID),3,0,0);
         if(prices[i][2]!=-1)
            {
            Alert("short : ",instrument[i]);
            }
            else
               {
               Alert("Error on ",instrument[i]," error_code: ",GetLastError());
               }

thanks 

Route206
211
Route206  
WHRoeder:
  1. Do not trade multiple currencies, you can't use any predefined variables, can't use the tester, must poll, and usually other problems.
  2. Code it to trade the chart pair only. Look at the other's if you must.
  3. Then put it on other charts to trade the other pairs. Done.

i'm sure that is the better approach - this is one however is where we're testing a basket and it behavior relative to others and eachother. 

As such, it serves a purpose ;-) 

To add comments, please log in or register