[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Can Anyone Figure Out The error In this Code



PureBytes Links

Trading Reference Links

 

_SECTION_BEGIN

//////////////////////////////// BAR SCALAR /////////////////////////////////

// When developing short-term trading systems that use complicated formulea

// it helps the be able to see system response to a changing bar. While you

// can step through a price chart to try and understand system behavior it is

// much easier to just place the cursor on the chart and modify the next bar

// accoring to some user input. The code below "scales" or "stretches" the bar:

// it magnifies HLC prices wrt the Open price of the bar. This allows you to

// test your system with gradual price changes and under controlled conditions.

// This is much easier then waiting for Real-Time price changes to show their

// effect.

SetBarsRequired(1000000,1000000);

BI = BarIndex();

SB = Min(LastValue(ValueWhen(SelectedValue(BI)+1 == BI,BI)), BarCount-1);

EnableScaling = ParamToggle("Apply Offset","DISABLED|ENABLED");

ScalingFactor = Param("HLC Scaling Factor",1,0,5,0.01);

if( EnableScaling )

{

Hd = H[sb]-O[sb];

Ld = O[sb]-L[sb];

Cd = C[sb]-O[sb];

Hd = ScalingFactor * Hd;

Ld = ScalingFactor * Ld;

Cd = ScalingFactor * Cd;

H[sb] = O[sb] + Hd;

L[sb] = O[sb] - Ld;

C[sb] = O[sb] + Cd;

}

Plot(C,"",1,128);

_SECTION_END

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___