Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

bharatk8

Pl. Correct Amibroker Code Which Distorts Chart View.

Recommended Posts

Hi

My code has Monthly,Weekly,Daily MTF lines.These MTF lines compress chart view.I have tried various scale options to correct this but theses attempts have failed to deliver desired results.Pl. suggest ways to plot only those MTF lines which are close to(40 pips below/above) current bar only.

_SECTION_BEGIN( "Monthly BB" );

 

TFm = inMonthly ;

 

TimeFrameSet( TFm );

 

ShowBBm9F = ParamToggle( "BB9 MTFm F", "Hide|Show", 1 );

ShowBBm9L = ParamToggle( "BB9 MTFm L", "Hide|Show", 1 );

PMTFm9 = Param( "Periom9 MTFm", 9, 2, 30, 1 );

WMTFm9 = Param( "Width9 MTFm", 1.5, 0, 10, 0.05 );

ShowBBm20F = ParamToggle( "BB20 MTFm F", "Hide|Show", 1 );

ShowBBm20L = ParamToggle( "BB20 MTFm L", "Hide|Show", 1 );

PMTFm20 = Param( "Periom20 MTFm", 20, 2, 30, 1 );

WMTFm20 = Param( "Width20 MTFm", 2, 0, 10, 0.05 );

Mm9 = WMA( C, PMTFm9 );

sdm9 = StDev( C, PMTFm9 );

Topm9 = Mm9 + WMTFm9 * sdm9;

Botm9 = Mm9 - WMTFm9 * sdm9;

Mm20 = WMA( C, PMTFm20 );

sdm20 = StDev( C, PMTFm20 );

Topm20 = Mm20 + WMTFm20 * sdm20;

Botm20 = Mm20 - WMTFm20 * sdm20;

 

TimeFrameRestore();

 

Mm9Fm = TimeFrameExpand( Mm9, TFm, expandFirst );

TP9Fm = TimeFrameExpand( TOPm9, TFm, expandFirst );

BT9Fm = TimeFrameExpand( BOTm9, TFm, expandFirst );

Mm20Fm = TimeFrameExpand( Mm20, TFm, expandFirst );

TP20Fm = TimeFrameExpand( TOPm20, TFm, expandFirst );

BT20Fm = TimeFrameExpand( BOTm20, TFm, expandFirst );

Mm9lm = TimeFrameExpand( Mm9, TFm, expandLast );

TP9lm = TimeFrameExpand( TOPm9, TFm, expandLast );

BT9lm = TimeFrameExpand( BOTm9, TFm, expandLast );

Mm20lm = TimeFrameExpand( Mm20, TFm, expandLast );

TP20lm = TimeFrameExpand( TOPm20, TFm, expandLast );

BT20lm = TimeFrameExpand( BOTm20, TFm, expandLast );

if ( ShowBBm9F )

//Plot( Mm9Fm, "MID BANm9 monthly First", colorOrange, styleLine| styleDashed | styleNoRescale );//styleDots |

if ( ShowBBm9F )

//Plot( TP9Fm, "TOP BANm9 monthly First", colorDarkRed, styleLine| styleDashed | styleNoRescale );//styleDots|

if ( ShowBBm9F )

//Plot( BT9Fm, "BOT BANm9 monthly First", colorDarkOliveGreen, styleLine | styleDashed| styleNoRescale );//styleDots|styleDashed |

if ( ShowBBm9L )

//Plot( Mm9lm, "MID BANm9 monthly Last", colorOrange, styleLine | styleDots | styleThick | styleNoRescale );

if ( ShowBBm9L )

//Plot( TP9lm, "TOP BANm9 monthly Last", colorOrange, styleLine | styleDots | styleThick | styleNoRescale );

if ( ShowBBm9L )

//Plot( BT9lm, "BOT BANm9 monthly Last", colorOrange, styleLine | styleDots | styleThick | styleNoRescale );

if ( ShowBBm20F )

//Plot( Mm20Fm, "MID BANm20 monthly First", colorBrown, styleLine | styleNoRescale );//styleDots |

if ( ShowBBm20F )

//Plot( TP20Fm, "TOP BANm20 monthly First", colorBrown, styleLine | styleNoRescale );

if ( ShowBBm20F )

//Plot( BT20Fm, "BOT BANm20 monthly First", colorBrown, styleLine | styleNoRescale );//styleDots |

if ( ShowBBm20L )

//Plot( Mm20lm, "MID BANm20 monthly Last", colorBrown, styleLine | styleDots | styleThick | styleNoRescale );

if ( ShowBBm20L )

//Plot( TP20lm, "TOP BANm20 monthly Last", colorBrown, styleLine | styleDots | styleThick | styleNoRescale );

if ( ShowBBm20L )

//Plot( BT20lm, "BOT BANm20 monthly Last", colorBrown, styleLine | styleDots | styleThick | styleNoRescale );

Share this post


Link to post
Share on other sites

I have tried following options mentioned in manual.But I have not received desired view.I have to keep adjusting Yaxis values in parameter window otherwise sometimes I can can hardly see candle.(see image)Pl. suggest necessary tweaking options.

 

Code 1:

mid1 = WMA( C, Period1 );

sd1 = StDev( C, Period1 );

Top1 = mid1 + Width1 * sd1;

Bot1 = mid1 - Width1 * sd1;

minimum = HighestVisibleValue( .99 * Bot1 );

maximum = LowestVisibleValue( 1.01 * Top1 );

 

HHm = ( TimeFrameGetPrice( "H", inMonthly, -1 ) ) ;

Plot( HHm, "High", colorBlack, styleDots, Minimum, Maximum);

 

Code 2:

 

Plot(IIf(HHm< HighestVisibleValue(Top1) AND HHm > LowestVisibleValue(Bot1),LL,Null ) , "HHm", colorBlack, styleLine | styleDots | styleThick );

 

P.S.I am not able to upload code due to some uploading issue.

5aa712740f273_allclouds.thumb.png.0ea942765476956a82e5899f0f8e2a7f.png

Share this post


Link to post
Share on other sites
I have tried following options mentioned in manual.But I have not received desired view.I have to keep adjusting Yaxis values in parameter window otherwise sometimes I can can hardly see candle.(see image)Pl. suggest necessary tweaking options.

 

Code 1:

mid1 = WMA( C, Period1 );

sd1 = StDev( C, Period1 );

Top1 = mid1 + Width1 * sd1;

Bot1 = mid1 - Width1 * sd1;

minimum = HighestVisibleValue( .99 * Bot1 );

maximum = LowestVisibleValue( 1.01 * Top1 );

 

HHm = ( TimeFrameGetPrice( "H", inMonthly, -1 ) ) ;

Plot( HHm, "High", colorBlack, styleDots, Minimum, Maximum);

 

Code 2:

 

Plot(IIf(HHm< HighestVisibleValue(Top1) AND HHm > LowestVisibleValue(Bot1),LL,Null ) , "HHm", colorBlack, styleLine | styleDots | styleThick );

 

P.S.I am not able to upload code due to some uploading issue.

 

Please give a proper code, not a buged code, expect people to help you.

 

The distortions is very easy - add a style no rescale.

Share this post


Link to post
Share on other sites

Pl. see image.

 

Chart on left is a view of my original AFL with styleNoReScale.I have changed yaxis parameters(minimum/maximum values of yaxis) for proper view.

 

Chart on right is a view of AFL with styleOwnScale.This AFL gives a view which is easy on eye and I do not need to change yaxis parameters for view.

 

But on close inspection,it becomes apparent that,MTF lines and cloud plots are not positioned correctly with reference to close of candle.

 

Pl. help

LAST TRY.txt

view.thumb.png.9de8f86c83ded4fafd5a41ac297b4441.png

Share this post


Link to post
Share on other sites

Hi

 

After all sort of experiments,view of chart has improved to some extent.But I think i should go for "ZOOM RECENT BARS".This feature is available in several softwares/terminals.May I have code for it?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Topics

  • Posts

    • Apparently, the murdering psychopussy military industrial complex is suffering from 'Middle East Fatigue'. Oh dear, the poor little lambs must be bored of killing 500k innocent people and displacing 10 million others all based on a pack of never ending lies. Obviously, you won't need the host to give you a blow by blow account of how you're being treated like a 5 year old..
    • Don't have time to post Big Picture today... quick notes:  I could almost re-post same content again ... 4 weeks later ??  except -  index finger is back up to speed Out of half the N copper position near 3.2 on Wed.  Just tucked stop on rest of the position up under today's lows... that's what reminded me of that Big Picture post PM’s: are still precious   ... "Silver is the new gold"  ;0 lol ... and if you take that seriously ... jokes on you... have a great weekend all.
    • ...been banging / just sayin' on this for a while now http://www.informationliberation.com/?id=58283
    • (... only posted because not much will be said on msm about these...)   There is ‘under the law’ and there is ‘above the law’  ... just sayin’
      https://www.zerohedge.com/news/2018-04-20/nunes-gowdy-and-goodlatte-go-nuclear-after-comey-memos-released
          speaking of msm There is ‘under the truth’ and there is ‘above the truth’  ... just sayin’ https://www.strategic-culture.org/news/2018/04/19/how-guardian-fulfills-george-orwell-prediction-of-newspeak.html
    • Date : 20th April 2018.

      MACRO EVENTS & NEWS OF 20th April 2018.



      FX News Today

      European Outlook: SNB’s Jordan sees no need for change in policy. The Swiss central bank President told Bloomberg last night that “there is no need to do anything regarding monetary policy at this morning”. Speaking after the CHF broke through the 1.20 per euro mark for the first time since the SNB gave up that ceiling, Jordan said the franc’s drop goes in the “right direction” but added that the currency is still considered a haven and the situation “fragile” and prone to change. So the SNB “remains very prudent” and “convinced that the current monetary policy is still necessary”. Further confirmation that the SNB is firmly on hold while watching also the ECB’s move very closely. If and when the ECB finally starts to reign in its support it will also increase the room for the SNB to manoeuvre. Bloomberg polls predict the first rate hike from the SNB in the last quarter of 2019.

      US Updates: Revealed a Philly Fed rise to 23.2 in April and a 1k initial claims downtick to a slightly-elevated 232k in the BLS survey week of April. The ISM-adjusted Philly Fed beat estimates with only a small April drop to 59.7 from a 45-year high of 61.8 in March, thus outperforming Monday’s Empire State where we saw an April drop to 15.8 from 22.5 with an ISM-adjusted decline to 56.2 from 57.3. For claims, the trend remains tight despite modestly higher readings over the last three weeks, as the moving Easter holiday and school breaks often distort April claims. We still expect a 210k April nonfarm payroll rise. The weekly Bloomberg consumer comfort index hit a third consecutive new cycle-high in mid-April of 58.1, and leading indicators rose 0.3% in March to leave a 22-month stretch without a decline, and a rise in the 6-month annualized reading to a lofty 8.8%

      Charts of the Day



      Main Macro Events Today
        CAD Retail sales – Expectations are for an improvement of 0.5% in February after the 0.3% gain in January. The ex-autos sales aggregate is expected at +0.3% after the 0.9% gain in January. The CPI’s gasoline price index edged 0.7% lower in February after jumping 3.2% in January following a 3.3% drop in December. % m/m inline with expectations CAD CPI – Expect March CPI, due Friday, to expand 0.4% (m/m) after the 0.6% surge in February. The annual growth rate is projected at 2.5% in March, up from the 2.2% y/y pace seen in February that was the fasted rate of CPI growth since the 2.4% pace in October of 2014. The BoC took the recent CPI climb in stride, viewing it as in line with their outlook. The temporary factors that had been restraining inflation, the Bank explained, “have largely dissipated, as expected.” The close to 2% core inflation rates are consistent with an “economy operating with little slack.” Inflation in 2018 is expected to be modestly higher than they expected in January, but due to the transitory impact of higher gas prices and recent minimum wage increases. See the preview. IMF Speeches – Saunders (BOE) Weidmann (Buba) Williams (FOMC) Support & Resistance Levels



      Always trade with strict risk management. Your capital is the single most important aspect of your trading business.

      Please note that times displayed based on local time zone and are from time of writing this report.

      Click HERE to access the full HotForex Economic calendar.

      Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE!

      Click HERE to READ more Market news. 


      Stuart Cowell
      Senior Market Analyst
      HotForex


      Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
×

Important Information

By using this site, you agree to our Terms of Use.