Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information
I came across this post on another thread, I would like to draw you attention to the code sample give. Its part of the new Phoenix stop management.
I never looked at any of daraknor code before and did not care to see this as well. But it was there ... Boy ... am speechless ... What a mess ... He doesnot know how to program, hes learning on this project. I have to say hes a fast learner. But this code is overflowing all over ... its done in a style that will garrantee bugs. He doenot understand Procedural protocal at all and is claming to code in modules. Look at the last function ModifySL() the name implies that the stop loss will be changed but the Take Profit is being changed as well behine the sence without your knowledge. That is so wrong. The function is of BOOL type and returns nothing and no returns statements in any Procedural construction. By the way Learn what the differents between a function procedure and routine procedure are.
I have re-writen the code, don't know if there are any errors in it as I did not check his math nor did I test it. This is a learning exersise for Daraknor.
And if you dont like my spelling TAFF.
The CockeyedCowboy
Rides again
Quote:
Originally Posted by daraknor
Velocity4x is a whitelabel company. I called them and asked a bunch of questions. They share a liquidity pool with IBFX, FXLQ and FXSOL although they did not state so explicitly (vague references to a 3 member exchange, "our bank", and other crap identical to crap fed by the parties mentioned.)
MiG has a very erratic signal from what I saw scanning their charts. We did live testing for Phoenix on several brokers, and FXDD almost always was the top performer. The second in line, occasionally first, was NF. I researched FXDD extensively, but not have done so for NF. PhoenixFund (a nonprofit that funds UN Development Program goals with EA trading proceeds) is now (finally) an IB for FXDD after months of work. (We did testing first, and then went with the winner.)
As for trailing stops, I have had long term 'average wins' several times higher than my TP thanks to tight delayed super-increasing trailing stops. (Eat those news events!) The trailing stop code was developed with the idea that we shouldn't leave pips on the table. Phoenix beta is getting a code cleaning/review from a fellow developer, here is the latest trailing stop code:
Code:
extern int staticTS =20;
extern bool MoveTPonTS=1; //increase Trailing stop by this value in pips each time TS is adjusted. Allows good trades to rise higher
extern int U_DelayTS=0;
//Every Tick, during order processing:
if (ExitManagedOn) trailingStop(myticket,staticTS,U_DelayTS);
void trailingStop (int ticket, int tsvalue, int delayts)
{ //TS Function, easily called by multiple exit strategies.
double slvalue;
Debug("EXIT:TS ticket:"+ticket+" tsvalue:"+tsvalue+" delayts:"+delayts);
if (OrderType() == OP_BUY)
{
slvalue=Bid-(Point*tsvalue);
if (OrderStopLoss() < slvalue && OrderOpenPrice()+Point*delayts<Bid+tsvalue*Point)
{
//Debug("OrderSL:" +OrderStopLoss()+ " slvalue:"+ slvalue);
if (!ModifySL(slvalue,ticket)) LogError();
}
} else {
if (OrderType() == OP_SELL)
{
slvalue=Ask+(Point*tsvalue);
if (OrderStopLoss() > slvalue && OrderOpenPrice()-Point*delayts>Ask-tsvalue*Point)
{
//Debug("OrderSL:" +OrderStopLoss()+ " slvalue:"+ slvalue);
ModifySL(slvalue,ticket);
}
}
}
}
bool ModifySL(double sl, int ticket)
{ //Moving SL function, easily called by other exit strategies.
int MoveTP;
if (OrderType() == OP_SELL) MoveTP=MoveTPonTS*(-1);
else MoveTP=MoveTPonTS;
Debug("MODIFY Ticket:"+ticket+" OpenPrice:"+OrderOpenPrice()+" SL:"+sl+" TP:"+(OrderTakeProfit()+MoveTP*Point));
if(OrderModify(ticket,OrderOpenPrice(),sl,OrderTakeProfit()+MoveTP*Point,0,Red)!=(-1)) LogError();
}
Code:
extern int
BaseTrailStop = 20, DelayTrailStop = 0;
extern bool
AdvanceTrailStop = 1;
bool
ManagedStops = ON, // Switch to apply a trailing stop to the system orders.
DeBugMessages = ON; // Switch to display DeBugging messages for code development stage.
if( ManagedStops )
TrailingStop( TicketNumber, BaseTrailStop, DelayTrailStop );
//«« <<<< Management of Trailing Stops, Routine Procedure >>>> »»»»»»»»»»»»»»»»»»»»»»»»»»»»
void
TrailingStop( int Ticket, int StopValue, int Delay ) {
double NewStop = 0;
if( OrderSelect( Ticket, SELECT_BY_TICKET ) == True );
if( OrderType() == OP_BUY ) {
NewStop = Bid - ( Point * StopValue );
if( OrderStopLoss() < NewStop && OrderOpenPrice() + Point * Delay < Bid + StopValue * Point )
ModifyStopLoss( Ticket, NewStop ) {
} else if( OrderType() == OP_SELL ) {
NewStop = Ask + ( Point * StopValue );
if( OrderStopLoss() > NewStop && OrderOpenPrice() - Point * Delay > Ask - StopValue * Point )
ModifyStopLoss( Ticket, NewStop ) {
} else {
if( DeBugMessages )
Print( "Error: Unreconized order type in TSFunction, Order Type: " + OrderType() );
} // End if, OrderType:
} else {
if( DeBugMessages )
Print( "Error: Unreconized order number in TSFunction, Ticket: " + Ticket );
} // End If, OrderSelect:
return;
} // End Routine Procedure, TrailingStop:
//«« <<<< Moddifing of Trailing Stops, Routine Procedure >>>> »»»»»»»»»»»»»»»»»»»»»»»»»»»»»
void
ModifyStopLoss( int Order, double MoveStop ) {
if( OrderModify( Ticket, OrderOpenPrice(), MoveStop, OrderTakeProfit(), 0, Red ) == True ) {
Print( "Order Stop Loss Modified Order Number: " + Order + " Seccessfully completed" ):
} else {
if( DeBugMessages )
Print( "Error in ModifyStopLoss Function: Modifing Order Number; " + Order + " Failed" );
} // End If, OrderModify:
return;
} // End Routine Procedure, ModifyStopLoss:
MoveTPonTS is zero in other code versions. It is a user configurable parameter, and I refer to the trailing stops as "tight, delayed and expanding" Use of trailing stops normally decreases the average profit. Use of tight, delayed, expanding TS increases the average profit in 4 EA myself and others have tested it on.
The documentation for P6 is very important, however I am not inclined to create any P6 documentation, until I understand whether there will be preferred setting again like P5. If not what are your thoughts on the prefix for the variable names for the external variables. They are a mix of P_ and U_ at the moment. I would like to have stabilized signals and variable names before documentation starts. I don't want to have too much change going on.
The difference between Chimera and Phoenix is just the entry signals.
For Phoenix 6, why does MetaEditor give me compile errors saying TimeCurrent - function is not defined? What do I need to do. For now I am using Time[0].
I won't use Time[0] because it just returns the opening time of the current bar. Feel free to use Time[0] if you like, but I recommend upgrading your version of MT4. What build are you running?
I won't use Time[0] because it just returns the opening time of the current bar. Feel free to use Time[0] if you like, but I recommend upgrading your version of MT4. What build are you running?
I upgraded to 2.03 but, I was using 1.98 MetaEditor, because I have two version installed now. Thanks. I made sure I was using 2.03 MetaEditor and tried again.
If you are using Phoenix6 you need to edit the name of the currency. If you are testing GBPUSD, the settings file would show GBPUSD in the U_Trade_Currency field. I believe the default you're using is USDJPY. I know this is a hassle for optimization, but the settings are actually this specific too :/
Hello everyone
I would like to know:
Is P6 still time sensitive? Meaning do I have to start it Sunday evening and turn it off Saturday, or can I open and close everyday anytime and still get good results?
Both, but the account won't synchronize with other traders if you keep opening and closing it and they don't. There is also the ability to turn it off friday afternoon and back on monday at midnight in the EA