I do not know how to code a position select and modifier.

To add comments, please log in or register
micobez
68
micobez  
This is my line of codes. However it is not working, any help would be greatly appreciated. 
Seng Joo Thio
1759
Seng Joo Thio  
micobez:
This is my line of codes. However it is not working, any help would be greatly appreciated. 

Please change your ink cartridge... I can't see your code...

Nikolaos Pantzos
33973
Nikolaos Pantzos  
Seng Joo Thio:

Please change your ink cartridge... I can't see your code...

Nice... hehe

micobez
68
micobez  
 if(PositionsTotal()>0){
  
  for(int i=0;i>=0;i++)
  {
string position =PositionGetSymbol( i);
int TYPE=PositionGetInteger(POSITION_TYPE);


// buy
if(TYPE==POSITION_TYPE_BUY);
{
double profitpoint= .70*(Rotprofitbuy-Rotslbuy)+Rotslbuy;
if(Ask>=profitpoint){
double newsl= 0.5*(Rotprofitbuy-Rotslbuy)+Rotslbuy;
bool res= trade.OrderModify(i,NULL,newsl,Rotprofitbuy,NULL,NULL,NULL);
}}
// sell
if(TYPE==POSITION_TYPE_SELL);
{
double profitpoint= 0.7*(Rotslsell-Rotprofitsell)+Rotprofitsell;
if(Bid<=profitpoint){
double newsl= 0.5*(Rotslsell-Rotprofitsell)+Rotprofitsell;
bool res= trade.OrderModify(i,NULL,newsl,Rotprofitbuy,NULL,NULL,NULL);
}
}


}}
}}
To add comments, please log in or register