JPY issues

 

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. 

 
Bid is only valid for the current chart symbol.
 
 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.
 

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 

 
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 ;-)