Renko Coding Question?

Post Reply
ewinner
Trader
Posts: 36
Joined: Wed Nov 16, 2011 9:36 am
Location: South West Ireland

Renko Coding Question?

Post by ewinner »

Hi Everyone,

Im a long time trader of renko blocks and have been working on a strategy that involves 2 offline charts, a 5 pip renko block (M2 offline) and a 10 pip renko block (M3 offline).

I want to try and automate a strategy using values from both charts but having problems, my question is - if i place the EA on the 5 pip chart i can call in the values easily for that chart using '0' as the timeframe, but how do i get the values from the 10 pip block offline chart?

Ive tried changing the timeframe to, PERIOD_M3 (and define it at the top), but this does not work.

---------------------------------------------------------------------------------------------------------------------------
void pip10()

{
pip10 = none;

if (iClose("EURUSD",PERIOD_M3,1) > iOpen("EURUSD",PERIOD_M3,1)) pip10 = up;
if (iClose("EURUSD",PERIOD_M3,1) < iOpen("EURUSD",PERIOD_M3,1)) pip10 = down;

}//void pip10()
----------------------------------------------------------------------------------------------------------------------------


Ive searched Google, trawled the mql4 site but cannot find any similiar requests or code snippets to play with.

Sorry if this is blatantly obvious, i just cannot see it.. :oops:

Thanks for any advice/help on this..

Mark
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Renko Coding Question?

Post by gaheitman »

ewinner wrote:Hi Everyone,

Im a long time trader of renko blocks and have been working on a strategy that involves 2 offline charts, a 5 pip renko block (M2 offline) and a 10 pip renko block (M3 offline).

I want to try and automate a strategy using values from both charts but having problems, my question is - if i place the EA on the 5 pip chart i can call in the values easily for that chart using '0' as the timeframe, but how do i get the values from the 10 pip block offline chart?

Ive tried changing the timeframe to, PERIOD_M3 (and define it at the top), but this does not work.

---------------------------------------------------------------------------------------------------------------------------
void pip10()

{
pip10 = none;

if (iClose("EURUSD",PERIOD_M3,1) > iOpen("EURUSD",PERIOD_M3,1)) pip10 = up;
if (iClose("EURUSD",PERIOD_M3,1) < iOpen("EURUSD",PERIOD_M3,1)) pip10 = down;

}//void pip10()
----------------------------------------------------------------------------------------------------------------------------


Ive searched Google, trawled the mql4 site but cannot find any similiar requests or code snippets to play with.

Sorry if this is blatantly obvious, i just cannot see it.. :oops:

Thanks for any advice/help on this..

Mark
According to the fratelli thread (http://www.stevehopwoodforex.com/phpBB3 ... lose#p1662) what you are trying to do should work. The only thing I see is that they are using NULL instead of the currency name. Are you creating the M2 and M3 offline charts in the correct directory?

George
ewinner
Trader
Posts: 36
Joined: Wed Nov 16, 2011 9:36 am
Location: South West Ireland

Re: Renko Coding Question?

Post by ewinner »

Hi George,

Thanks for your reply and link, i hadnt seen that thread :oops:

Just changed the code to below which solved the problem perfectly

Great stuff, learning everyday.. thanks again

Mark

-----------------------------------------------------------------------------------------------------------------
void pip10()

{
pip10 = none;

if (iClose(NULL,3,1) > iOpen(NULL,3,1)) pip10 = up;
if (iClose(NULL,3,1) < iOpen(NULL,3,1)) pip10 = down;

}//void pip10()
----------------------------------------------------------------------------------------------------------------------
Post Reply

Return to “Coders Hangout”