stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Fix Needed
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=810
Page 1 of 1
Author:  Reverie1987 [ Wed Sep 12, 2012 8:40 am ]
Post subject:  Fix Needed

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!
Author:  dietcoke [ Wed Sep 12, 2012 9:16 am ]
Post subject:  Re: Fix Needed

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
Author:  Reverie1987 [ Wed Sep 12, 2012 9:22 am ]
Post subject:  Re: Fix Needed

Thank you Sir.

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

Thank a lot!
Author:  Reverie1987 [ Wed Sep 12, 2012 10:54 pm ]
Post subject:  Re: Fix Needed

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

Much appreciated.
Author:  Bruce Flea [ Thu Sep 13, 2012 12:04 am ]
Post subject:  Re: Fix Needed

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.
All times are UTC Page 1 of 1