If solve reward you

Posted By: tuuPaul

If solve reward you - 11/13/18 10:34

Hello guys i have very difficult problem. It will be easy for you.
Function trade1(){
Timeframe=1;
If (confition1){
If(asset("eur/jpy"))
Printf("Buyeurjpy");
Else if(asset("gbp/jpy"))
Printf("Buygbpjpy");

}
}
Function run(){
While(asset(loop("eur/jpy","gbp/jpy")))
While(algo(loop("code1")))
{
If(algo=="code1")
Trade1();
}
}


I run this. Condition1 met at eurjpy and gbpjpy at same time. Then gives me unwanted this result in zorro's display and log:

BuyeurjpyBuyeurjpy

Actually i need result of

BuyeurjpyBuygbpjpy

How can i solve this. If you help me i reward you:-)
Posted By: kvm

Re: If solve reward you - 11/13/18 11:47

You should test the Asset variable not calling the asset() method again in your trade() function:
Code:
if(Asset == "eur/jpy")
  printf("Buyeurjpy");
else if(Asset == "gbp/jpy")
  printf("Buygbpjpy");

Posted By: tuuPaul

Re: If solve reward you - 11/13/18 11:53

Your chose is not work. I tried it before
© 2024 lite-C Forums