Errors that I cannot seem to fix, ChatGPT also too stupid
Errors that I cannot seem to fix, ChatGPT also too stupid
15 May 2023, 10:25
Hi guys,
I am getting the following error in my code and I cant seem to fix it
if (is_16_00 && Convert.ToBoolean(go_long))
{
double take_profit = Symbol.Ask + Symbol.PipSize * tp_value;
var result = ExecuteMarketOrder(TradeType.Buy, Symbol.Name, Symbol.NormalizeVolume(0.1), Symbol.Ask, 1, 0, take_profit, "buy");
if (result.IsSuccessful)
{
Print("Buy order placed");
}
else
{
Print("Buy order failed with error code: ", result.Error);
}
}
Errors
Symbol.Ask highlighted ,Cannot convert from double to bool
take_profit highlighted, Cannot convert double to string
"buy" highlighted, cannot convert from string to bool
firemyst
18 May 2023, 08:18
RE:
umadrat2012 said:
You have the wrong parameters for your call to the ExecuteMarketOrder method.
For starters, no ExecuteMarketOrder API call takes a "double" (Symbol.Ask) as the 4th parameter.
@firemyst