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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • 📁 Population in 2100, as projected by UN Population Division.   🇮🇳 India: 1,533 million 🇨🇳 China: 771 million 🇳🇬 Nigeria: 546 million 🇵🇰 Pakistan: 487 million 🇨🇩 Congo: 431 million 🇺🇸 US: 394 million 🇪🇹 Ethiopia: 323 million 🇮🇩 Indonesia: 297 million 🇹🇿 Tanzania: 244 million 🇪🇬 Egypt: 205 million 🇧🇷 Brazil: 185 million 🇵🇭 Philippines: 180 million 🇧🇩 Bangladesh: 177 million 🇳🇪 Niger: 166 million 🇸🇩 Sudan: 142 million 🇦🇴 Angola: 133 million 🇺🇬 Uganda: 132 million 🇲🇽 Mexico: 116 million 🇰🇪 Kenya: 113 million 🇷🇺 Russia: 112 million 🇮🇶 Iraq: 111 million 🇦🇫 Afghanistan: 110 million   @FinancialWorldUpdates Profits from free accurate cryptos signals: https://www.predictmag.com/   
    • “If the West finds itself falling behind in AI, it won’t be due to a lack of technological prowess or resources. It won’t be because we weren’t smart enough or didn’t move fast enough. It will be because of something many of our Eastern counterparts don’t share with us: fear of AI.   The root of the West's fear of AI can no doubt be traced back to decades of Hollywood movies and books that have consistently depicted AI as a threat to humanity. From the iconic "Terminator" franchise to the more recent "Ex Machina," we have been conditioned to view AI as an adversary, a force that will ultimately turn against us.   In contrast, Eastern cultures have a WAY different attitude towards AI. As UN AI Advisor Neil Sahota points out, "In Eastern culture, movies, and books, they've always seen AI and robots as helpers and assistants, as a tool to be used to further the benefit of humans."   This positive outlook on AI has allowed countries like Japan, South Korea, and China to forge ahead with AI development, including in areas like healthcare, where AI is being used to improve the quality of services.   The West's fear of AI is not only shaping public opinion but also influencing policy decisions and regulatory frameworks. The European Union, for example, recently introduced AI legislation prioritizing heavy-handed protection over supporting innovation.   While such measures might be well-intentioned, they risk stifling AI development and innovation, making it harder for Western companies and researchers to compete.   Among the nations leading common-sense AI regulation, one stands out for now: Singapore.” – Chris C Profits from free accurate cryptos signals: https://www.predictmag.com/ 
    • $NFLX Netflix stock hold at 556.59 support or breakdown?  https://stockconsultant.com/?NFLX
    • $RDNT Radnet stock flat top breakout watch, https://stockconsultant.com/?RDNT
    • $GNK Genco Shipping stock narrow range breakout watch, also see $GOGL https://stockconsultant.com/?GNK
×
×
  • Create New...

Important Information

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