George Johnson / Publications
Forum
Order Send error 138 ?
void OrderEntry( int direction) { if (direction== 1 ) if ( OrderSend ( Symbol (),OP_BUY,GetLongContracts(),Ask,SLIPPAGE,GetStopLossLongPrice(), 0 , NULL ,MagicNumber, 0 ,Green) < 0 ) { Print ( "Order Send failed, error # " , GetLastError ()); RefreshRates (); } if
Back testing taking hours ?
I use the Strategy Tester when trying to optimise parameters for my code although back testing only 3 years of data on open prices only can take 30 hours, does it really take this long (it never used to), I have read elsewhere that having a optimised code can speed up back testing, what sort of
Getting out of trades
Hi I recently got flicked out of a trade on the weekend, and I'm now looking at ways of exiting on Friday and trying to re-enter on Monday at a similar price, I'm brainstorming ideas of how to do it, any ideas or anyone have the same problem? the best i can come up with would be exiting on Friday at
Lot Sizing
Hi I would like to create a function that computes the correct lot size for all forex pairs and commodities. is this possible ? where should I start ? I have a fixed stop loss and risk percentage Thanks
what is the best code for identifying a new bar ??
what is the best code for identifying a new bar
executing the sell order
void CheckForSHORTTrade() { if ((calcShort1()||calcShort2()) && calcShort3() && calcShort4() && calcShort5()) { OrderEntry( 0 ); } } void OrderEntry( int direction) { if (direction== 0 ) Alert ( "SHORT" ); OrderSend ( Symbol (), OP_SELL
How to calculate the cost of one contract ?
i know how to calculate ticksize double Ticksize = MarketInfo( Symbol (),MODE_TICKSIZE); and lot size double Lotsize = MarketInfo( Symbol (),MODE_LOTSIZE); but how do i calculate the cost of one contract? and the smallest possible change in profit when you are in trade
Updating Information on tick ?
//O double O() { return iOpen ( _Symbol , _Period , 0 ); } //H double H() { return iHigh ( _Symbol , _Period , 0 ); } //L double L() { return = iLow ( _Symbol , _Period , 0 ); } //C double C() { return iClose ( _Symbol , _Period , 0 ); } bool calcLong1() { O=O(); H=H(); L=L();
Why is this not returning true ?
bool calcLong3; bool calcShort3; bool calcLong3() { double RSI = iRSI ( _Symbol , _Period , 14 , PRICE_CLOSE , 0 ); if (RSI< 70 ) return true ; else return false ; } bool calcShort3() { double RSI = iRSI ( _Symbol , _Period , 14 , PRICE_CLOSE , 0 ); if (RSI>