please try to code from Amibroker AFL to MQL4

Dear mladen and Mr tools please look the code is from Amibroker is it possible to write the same logic in Mt4 because the code is of very few lines but looks so powerfull ..

 

_SECTION_BEGIN("0409");

sma10_hotfx = MA( Close, 10 ); 

Vol_hotfx = StDev( sma10_hotfx, 10 );  


SetForeign("^nsei" ); 

// at this point Close represents FHYTX close price 


sma20_fhytx = MA( Close, 20 ); 

Vol_fhytx = StDev( sma20_fhytx, 20 ); 


diffbuy = (Close - sma20_fhytx)/( 2 * Vol_fhytx ); 

diffsell = (Close - sma20_fhytx)/( 2 * Vol_fhytx ); 


RestorePriceArrays(); 

// now we are back to HOTFX 


Sell = ( diffsell < -1 ) AND 

       ((Close - sma10_hotfx)/( 2 * Vol_hotfx )) < -1; 


Buy = ( diffbuy > 1 ) AND ( Close > sma10_hotfx );


Plot(C,"",47,64);

Buy=ExRem(Buy,Sell);

Sell=ExRem(Sell,Buy);

//Short=ExRem(Short,Cover);

//Cover=ExRem(Cover,Short);

PlotShapes(Buy*shapeUpArrow,colorAqua ,0,L);

PlotShapes(Sell*shapeDownArrow,colorGold,0,H);

_SECTION_END();

Files:
ami.png  37 kb
shiva12:

Dear mladen and Mr tools please look the code is from Amibroker is it possible to write the same logic in Mt4 because the code is of very few lines but looks so powerfull ..

 

_SECTION_BEGIN("0409");

sma10_hotfx = MA( Close, 10 ); 

Vol_hotfx = StDev( sma10_hotfx, 10 );  


SetForeign("^nsei" ); 

// at this point Close represents FHYTX close price 


sma20_fhytx = MA( Close, 20 ); 

Vol_fhytx = StDev( sma20_fhytx, 20 ); 


diffbuy = (Close - sma20_fhytx)/( 2 * Vol_fhytx ); 

diffsell = (Close - sma20_fhytx)/( 2 * Vol_fhytx ); 


RestorePriceArrays(); 

// now we are back to HOTFX 


Sell = ( diffsell < -1 ) AND 

       ((Close - sma10_hotfx)/( 2 * Vol_hotfx )) < -1; 


Buy = ( diffbuy > 1 ) AND ( Close > sma10_hotfx );


Plot(C,"",47,64);

Buy=ExRem(Buy,Sell);

Sell=ExRem(Sell,Buy);

//Short=ExRem(Short,Cover);

//Cover=ExRem(Cover,Short);

PlotShapes(Buy*shapeUpArrow,colorAqua ,0,L);

PlotShapes(Sell*shapeDownArrow,colorGold,0,H);

_SECTION_END();

That is simple Bollinger bands breakout system

You can find 100's of versions for metatrader

mladen:

That is simple Bollinger bands breakout system

You can find 100's of versions for metatrader

ok thanks dear mladen will try to get it