Author Topic: What is wong with code for BB lines crossing MTF lines  (Read 5584 times)

bharatk8

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
What is wong with code for BB lines crossing MTF lines
« on: October 01, 2010, 02:12:47 am »
Yesterday,I witnessed good trade in one scrip in which BB bottom of hourly chart had crossed  MTF line,I tried to mimic by following code.

Buy=(Cross((MD9Fd OR TP9Fd  OR BT9Fd  OR MD20Fd  OR TP20Fd  OR BT20Fd  OR MD9Ld  OR TP9Ld  OR BT9Ld  OR MD20Ld  OR TP20Ld  OR BT20Ld),Bot1)) OR

(Cross(Bot1,(MD9Fd OR TP9Fd  OR BT9Fd  OR MD20Fd  OR TP20Fd  OR BT20Fd  OR MD9Ld  OR TP9Ld  OR BT9Ld  OR MD20Ld  OR TP20Ld  OR BT20Ld)));

But some how the scrip which gave me good move did not appear in auto analysis window instead another scrip's name cropped up which was not as per code. .In above code Bot1 is name specified for BB bottom in my original code.Rest are codes for different MTF lines.What am I missing?                     

administrator

  • Administrator
  • Full Member
  • *****
  • Posts: 200
    • View Profile
Re: What is wong with code for BB lines crossing MTF lines
« Reply #1 on: October 01, 2010, 08:12:54 pm »
Can you post a screen-shot? I not sure I understand what you are talking about.

bharatk8

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: What is wong with code for BB lines crossing MTF lines
« Reply #2 on: October 01, 2010, 10:30:55 pm »
Pl. see image.

see BB bottom(blue line) and Daily MTF line(solid yellow line) crossing at 2 vertical lines.Price went up sharply inspite of gap down opening.

bharatk8

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: What is wong with code for BB lines crossing MTF lines
« Reply #3 on: October 01, 2010, 11:07:53 pm »
vertical lines are drawn to point out crossing of BB and MTF line

administrator

  • Administrator
  • Full Member
  • *****
  • Posts: 200
    • View Profile
Re: What is wong with code for BB lines crossing MTF lines
« Reply #4 on: October 02, 2010, 02:05:31 am »
Hello

The code you posted looks wrong for what you want. But I can't help here since I don't know the code for those yellow lines. If you post it I may be able to help.

bharatk8

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: What is wong with code for BB lines crossing MTF lines
« Reply #5 on: October 02, 2010, 02:12:47 am »
Thanx for prompt reply.All daily MTF lines are yellow in color and  codes for all 12MTF lines have been given in post#1 in this thread itself.

I am posting more info about these MTF lines as follows.

Code: [Select]
_SECTION_BEGIN("Daily BB");
TFd = inDaily ;
TimeFrameSet(TFd);
ShowBBd9F=ParamToggle("BB9 MTFd F", "Hide|Show",1);
ShowBBd9L=ParamToggle("BB9 MTFd L", "Hide|Show",1);
PMTFd9 = Param("Period9 MTFd", 9, 2, 30, 1 );
WMTFd9 = Param("Width9 MTFd", 1.5, 0, 10, 0.05 );


ShowBBd20F=ParamToggle("BB20 MTFd F", "Hide|Show",1);
ShowBBd20L=ParamToggle("BB20 MTFd L", "Hide|Show",1);
PMTFd20 = Param("Period20 MTFd", 20, 2, 30, 1 );
WMTFd20 = Param("Width20 MTFd", 2, 0, 10, 0.05 );

Md9= WMA(C,PMTFd9);
sdd9  = StDev( C, PMTFd9 );
Topd9 = Md9 + WMTFd9 * sdd9;
Botd9 = Md9 - WMTFd9 * sdd9;

Md20 = WMA(C,PMTFd20);
sdd20  = StDev( C, PMTFd20);
Topd20 = Md20 + WMTFd20 * sdd20;
Botd20 = Md20 - WMTFd20 * sdd20;

TimeFrameRestore();

MD9Fd = TimeFrameExpand(Md9,TFd, expandFirst );
TP9Fd = TimeFrameExpand(TOPd9,TFd, expandFirst );
BT9Fd = TimeFrameExpand(BOTd9,TFd, expandFirst );
MD20Fd = TimeFrameExpand(Md20,TFd, expandFirst );
TP20Fd = TimeFrameExpand(TOPd20,TFd, expandFirst );
BT20Fd = TimeFrameExpand(BOTd20,TFd, expandFirst );
MD9Ld = TimeFrameExpand(Md9,TFd, expandLast );
TP9Ld = TimeFrameExpand(TOPd9,TFd, expandLast );
BT9Ld = TimeFrameExpand(BOTd9,TFd, expandLast );
MD20Ld = TimeFrameExpand(Md20,TFd, expandLast );
TP20Ld = TimeFrameExpand(TOPd20,TFd, expandLast );
BT20Ld = TimeFrameExpand(BOTd20,TFd, expandLast );

if(ShowBBd9F)                                                                 
Plot(MD9Fd, "MID BAND9 Daily First", colorYellow, styleLine |styleDots| styleDashed|styleNoRescale );

if(ShowBBd9F)
Plot(TP9Fd, "TOP BAND9 Daily First", colorYellow, styleLine |styleDots| styleDashed|styleNoRescale);

if(ShowBBd9F)
Plot(BT9Fd, "BOT BAND9 Daily First", colorYellow, styleLine |styleDots| styleDashed|styleNoRescale );

if(ShowBBd9L)                                                                 
Plot(MD9Ld, "MID BAND9 Daily Last", colorYellow, styleLine |styleDots| styleThick|styleNoRescale );

if(ShowBBd9L)
Plot(TP9Ld, "TOP BAND9 Daily Last", colorYellow, styleLine |styleDots| styleThick |styleNoRescale );

if(ShowBBd9L)
Plot(BT9Ld, "BOT BAND9 Daily Last", colorYellow, styleLine |styleDots| styleThick|styleNoRescale );


if(ShowBBd20F)
Plot(MD20Fd, "MID BAND20 Daily First", colorYellow, styleLine |styleDots| styleDashed|styleNoRescale );

if(ShowBBd20F)
Plot(TP20Fd, "TOP BAND20 Daily First", colorYellow, styleLine |styleDots| styleDashed|styleNoRescale );

if(ShowBBd20F)
Plot(BT20Fd, "BOT BAND20 Daily First", colorYellow, styleLine |styleDots| styleDashed|styleNoRescale );

if(ShowBBd20L)
Plot(MD20Ld, "MID BAND20 Daily Last", colorYellow, styleLine |styleDots| styleThick|styleNoRescale );

if(ShowBBd20L)
Plot(TP20Ld, "TOP BAND20 Daily Last", colorYellow, styleLine |styleDots| styleThick|styleNoRescale );

if(ShowBBd20L)
Plot(BT20Ld, "BOT BAND20 Daily Last", colorYellow, styleLine |styleDots| styleThick|styleNoRescale );


_SECTION_END();
« Last Edit: October 02, 2010, 06:44:11 pm by administrator »

administrator

  • Administrator
  • Full Member
  • *****
  • Posts: 200
    • View Profile
Re: What is wong with code for BB lines crossing MTF lines
« Reply #6 on: October 02, 2010, 06:43:44 pm »
Hello

The code should look more like the following if I understood you correctly:

Code: [Select]
Buy=(MD9Fd OR TP9Fd  OR BT9Fd  OR MD20Fd  OR TP20Fd  OR BT20Fd  OR MD9Ld  OR TP9Ld  OR BT9Ld  OR MD20Ld  OR TP20Ld  OR BT20Ld) > Bot1) AND

(Cross(Bot1,(MD9Fd OR TP9Fd  OR BT9Fd  OR MD20Fd  OR TP20Fd  OR BT20Fd  OR MD9Ld  OR TP9Ld  OR BT9Ld  OR MD20Ld  OR TP20Ld  OR BT20Ld)));

bharatk8

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: What is wong with code for BB lines crossing MTF lines
« Reply #7 on: October 02, 2010, 10:56:21 pm »
Your code looks logically better but still it has not returned name of Siemens. See image.Point out my mistake.

administrator

  • Administrator
  • Full Member
  • *****
  • Posts: 200
    • View Profile
Re: What is wong with code for BB lines crossing MTF lines
« Reply #8 on: October 03, 2010, 12:58:09 am »
Hello

I think I made a mistake in the code I gave you

Code: [Select]
Buy=(Bot1 > (MD9Fd OR TP9Fd  OR BT9Fd  OR MD20Fd  OR TP20Fd  OR BT20Fd  OR MD9Ld  OR TP9Ld  OR BT9Ld  OR MD20Ld  OR TP20Ld  OR BT20Ld)) AND

(Cross(Bot1,(MD9Fd OR TP9Fd  OR BT9Fd  OR MD20Fd  OR TP20Fd  OR BT20Fd  OR MD9Ld  OR TP9Ld  OR BT9Ld  OR MD20Ld  OR TP20Ld  OR BT20Ld)));