Phoenix 6 Expert vs Simple - page 5

 

Is these little Bugs

case 1440:

W_Trade_PERIOD="D1"; break;

case 10080:

W_Trade_PERIOD="D1"; break; //xox D7

case 43200:

W_Trade_PERIOD="D1"; break; //xox D30

Should the last two D1 entries be D7 and D30?

 

Clarification

Daraknor

This code is correct

if (!disableBuy && !disableSell)

But I would rather not see a double negative. People will have trouble with it.

if (enableBuy || enableSell)

I will send you the code by email

 
bool OrderModify( int ticket, double price, double stoploss, double takeprofit, datetime expiration, color arrow_color=CLR_NONE)

Modification of characteristics for the previously opened position or pending orders. If the function succeeds, the returned value will be TRUE. If the function fails, the returned value will be FALSE. To get the detailed error information, call GetLastError() function.

So

int results= OrderModify ( ticket, OrderOpenPrice(), sl, OrderTakeProfit(), 0, Red );

if(results!=(-1)) return(true);

else return(false);

could be coded

bool result= OrderModify ( ticket, OrderOpenPrice(), sl, OrderTakeProfit(), 0, Red );

return (result)

or the best perhaps - this will reduce a few CPU cycles

return ( OrderModify ( ticket, OrderOpenPrice(), sl, OrderTakeProfit(), 0, Red ) );

Daraknor

Which one will have less instruction?

 

Daraknor

The section followed by

//it looks funny, but it above statement is properly closed.

It is properly closed but I think is actually not doing what you want, I added a few brackets and will send you the code.

 

EASY signal misfiring

I figured out why the EASY signal is not working properly. It is currently taking the haClose value from the very first bar and sticking with it. haClose has to be defined so that it updates on every bar. Any suggestions.

 
Pcontour:
So
int results= OrderModify ( ticket, OrderOpenPrice(), sl, OrderTakeProfit(), 0, Red );

if(results!=(-1)) return(true);

else return(false);

could be coded

bool result= OrderModify ( ticket, OrderOpenPrice(), sl, OrderTakeProfit(), 0, Red );

return (result)

or the best perhaps - this will reduce a few CPU cycles

return ( OrderModify ( ticket, OrderOpenPrice(), sl, OrderTakeProfit(), 0, Red ) );

Daraknor

Which one will have less instruction?

I changed my style for order modify to this:

if(OrderModify(ticket,OrderOpenPrice(),sl,OrderTakeProfit(),0,Red)!=(-1)) LogError();

No variables needed, and the intended consequence is handled in line next to the event, instead of in a different chunk of code. LogError() basically does a GetLastError() and then write it to a log file.

 
autumnleaves:
I figured out why the EASY signal is not working properly. It is currently taking the haClose value from the very first bar and sticking with it. haClose has to be defined so that it updates on every bar. Any suggestions.

Old way is:

double haClose1 = (PRICE_OPEN + PRICE_HIGH + PRICE_LOW + PRICE_CLOSE)*(0.25);[/CODE]

But I'd recommend (and I think PContour might have as well):

double haClose1 = (Open[1] + High[1] + Low[1] + Close[1])*0.25;

The second one will give you the previous bar data. You can use Open[0] but it is the current bar and hasn't been completely written. To save a little on computing time if you are doing a lot of bar related activities is to only compute when a new bar is drawn:

[CODE]int barcount; //Global variable at the top of the EA

double haClose1; //Global variable

init()

{ //... all of the normal init information

barcount=Bars;

}

//Indicator code:

if(Bars>barcount)

{

haClose1 = (Open[1] + High[1] + Low[1] + Close[1])*0.25;

barcount=Bars;

}

 

EASY signal fix

Darak or anyone, do you have an idea how to fix the EASY signal? haClose needs to be defined on the current bar so that the result will be meaningful.

 
autumnleaves:
Darak or anyone, do you have an idea how to fix the EASY signal? haClose needs to be defined on the current bar so that the result will be meaningful.

You mean current bar high, low, open, close? They will need to be constantly updated, but just use [0] instead of [1]

 

Does anyone have a trade from Phoenix 6 this week(beginning from Mar 18,2007)?I still not have a trade from Phoenix 6.I am testing Phoenix6 ALPHA,Phoenix6 alpha EASY,andPhoenix6 alpha1.

Reason: