Fix Needed

Post Reply
Reverie1987
Posts: 5
Joined: Sat Sep 01, 2012 8:51 pm

Fix Needed

Post by Reverie1987 »

Hello,

Can someone help me with this EA? Having problems trying to compile it due to some errors. It seems like the more things I try to solve the more errors I get. :cry:

Please take a look at it and point me to the right directions. Was basically trying to copy and paste two codes together. =P :)

This is my first attempt. Hopefully I will not be badly done up.

Thanks in advance!
You do not have the required permissions to view the files attached to this post.
dietcoke
Trader
Posts: 162
Joined: Tue Nov 15, 2011 9:59 pm

Re: Fix Needed

Post by dietcoke »

Reverie1987 wrote:Hello,

Can someone help me with this EA? Having problems trying to compile it due to some errors. It seems like the more things I try to solve the more errors I get. :cry:

Please take a look at it and point me to the right directions. Was basically trying to copy and paste two codes together. =P :)

This is my first attempt. Hopefully I will not be badly done up.

Thanks in advance!

:lol: We've all been there.

I've made some corrections use a file comparer to see where.

There is a call to a non existant function called timecondition so I just created an empty function to trick the code and allow it to compile.

Do you have a backup of the last one that did compile.

If you don't, learn the lesson. Compile regularly and keep a backup each tim you make any changes
You do not have the required permissions to view the files attached to this post.
Image
Reverie1987
Posts: 5
Joined: Sat Sep 01, 2012 8:51 pm

Re: Fix Needed

Post by Reverie1987 »

Thank you Sir.

Took me 6hrs to solve it and few minutes form you =P

Thank a lot!
Reverie1987
Posts: 5
Joined: Sat Sep 01, 2012 8:51 pm

Re: Fix Needed

Post by Reverie1987 »

Can someone take a look at this and tell me where have I done wrong again?

Much appreciated.
You do not have the required permissions to view the files attached to this post.
Bruce Flea
Trader
Posts: 18
Joined: Mon Feb 13, 2012 4:43 am

Re: Fix Needed

Post by Bruce Flea »

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:

Code: Select all

int Order;
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.
Post Reply

Return to “Coders Hangout”