Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

arguments not valid
 Post subject: arguments not valid Post rating: 0   New post Posted: Fri 23 Mar, 2012, 00:38 

User rating: 1
Joined: Wed 07 Mar, 2012, 05:56
Posts: 101
Location: New CaledoniaNew Caledonia
hello support,

i have a trouble in my code.

if my syntax is that :
if(askBar1.getOpen() < askBar1.getClose() && askBar2.getOpen() < askBar2.getClose()
                && askBar3.getOpen() < askBar3.getClose()) {
           
                buySign = true;
                buyPrice = askBar2.getOpen() - getPipPrice(pipsBelow);           
                }


no problem the strategy open a trade when the condition is right
but if my syntax is that :

if(askBar1.getOpen() < askBar1.getClose() && askBar2.getOpen() < askBar2.getClose()
                && askBar3.getOpen() < askBar3.getClose() && askBar2.getHigh() < askBar3.getClose()) {
           
                buySign = true;
                buyPrice = askBar2.getOpen() - getPipPrice(pipsBelow);           
                }

the strategy doesn't open a trade even if conditions are right and i have no error messages.

i don't understand why.

best regards


 
 Post subject: Re: arguments not valid Post rating: 0   New post Posted: Fri 23 Mar, 2012, 08:30 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Consider logging your values to see why particular execution paths get taken:
https://www.dukascopy.com/wiki/#IConsole/Logging_values
For instance:
      console.getOut().println("askBar1: " + askBar1);
      console.getOut().println("askBar2: " + askBar2);
      console.getOut().println("askBar3: " + askBar3);
      console.getOut().println(String.format("%s %s %s %s",
            askBar1.getOpen() < askBar1.getClose(),      
            askBar2.getOpen() < askBar2.getClose(),
            askBar3.getOpen() < askBar3.getClose(),
            askBar2.getHigh() < askBar3.getClose()
      ));


 
 Post subject: Re: arguments not valid Post rating: 0   New post Posted: Fri 23 Mar, 2012, 09:52 

User rating: 1
Joined: Wed 07 Mar, 2012, 05:56
Posts: 101
Location: New CaledoniaNew Caledonia
wow!!! it's so complicated for me for the moment :lol: but i will try to understand.

ok thanks for your reply


 
 Post subject: Re: arguments not valid Post rating: 0   New post Posted: Fri 23 Mar, 2012, 09:54 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
just insert it in your strategy before the if statement and check the logged values.


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com