Reverie1987 wrote:Can someone take a look at this and tell me where have I done wrong again?
Take a look at this:
Code: Select all
if ( Order = OrderBuy && OpenTrades == 0)
{
SendLong = true;
}//if (SlowTrend == up && OpenTrades == 0)
//Secondary buys
if (Order = OrderBuy && OpenTrades < 3 && BuyOpen)
{
SendLong = true;
SendLots = QuarterLot;
}//if (FastTrend == up && OpenTrades < 3)
//Initial sell
if ( Order = OrderSell && OpenTrades == 0)
{
SendShort = true;
}//if (SlowTrend == down && OpenTrades == 0)
//Secondary sells
if (Order = OrderSell && OpenTrades < 3 && SellOpen)
{
SendShort = true;
SendLots = QuarterLot;
}//if (FastTrend == down && OpenTrades < 3)
These:
Code: Select all
//Trend detection
string OrderSell, OrderBuy;
And this one:
There's no value attached to the variables you used.
Order selection, and processing is an art on it's own. Calling an int, or a string, and calling it Order doesn't mean the program knows what order you're talking about. In fact, in your case, it has no clue.
You need to give it a value using OrderSelect() and give that a name, or something along those lines.
And also, ==, and = are two different things. If you are comparing values, like you are in your code, you need to use the == signs. Just using a single = in an "if" statement is incorrect syntax. You need to establish what your comparisons are before the if for the most part.
Your first line of code posted up top shows you what I mean:
if ( Order = OrderBuy && OpenTrades == 0)
{
SendLong = true;
It should read:
if ( Order == OrderBuy && Open Trades ==0)
{
SendLong = True;
}
But the problem is, "Order" and "OrderBuy" have no value. I didn't get as far as "OpenTrades", so I don't know about that.
Not to mention, "Order" is an integer, and "OrderBuy" is a string. You can't compare those values.