Simple Coding Help - No Promise.

trash

Well-Known Member
Dear Happy Singh

There is something i sincerely need your help. For volume at price chart, is there a way to display/determine the volume accumulated at each horizontal bar? if possible, can i code the horizontal volume bar for different color?let say bar turns to red if accumulated volume exceed number= 10000

_SECTION_BEGIN("Volume At Price");
PlotVAPOverlay( Param("Lines", 500, 100, 1000, 1 ), Param("Width", 12, 1, 100, 1 ), ParamColor("Color", colorGrey40 ), ParamToggle("Side", "Left|Right" ) | 4*ParamToggle("Z-order", "On top|Behind", 0 ) );
_SECTION_END();

Attached is the example of how it should be...

Thank you in advance, really need help from you , appreciate it, thank you
Purchase AmiBroker 6.2 then you can do it via PriceVolDistribution(...) function.
 

travi

Well-Known Member
Exploration issue:
AB Ver: 6.0 /32 bit

The following code, or with any intraday TF
TimeFrameSet(in15Minute);
va1 = Ref(H,1);
va2 = Ref(H,-1);
va3 = Ref(H,-2);
va4 = Ref(H,-3);

All the array variables when AddColumn, always evaluate with daily data.
so with above code,
its today high, yest high and so on.
Intention on 15m TF, is to get current high, prev 15m high and so on.

Filter settings, all 3 tried, bar, 1 recent day and daily range.

Any suggestion? I also double checked the data, its 1m data for prev 5 days.

Say for eg. I want to explore
C > H AND (Ref(H, -1) > Ref(H, -2));
 
Exploration issue:
AB Ver: 6.0 /32 bit

The following code, or with any intraday TF
TimeFrameSet(in15Minute);
va1 = Ref(H,1);
va2 = Ref(H,-1);
va3 = Ref(H,-2);
va4 = Ref(H,-3);

All the array variables when AddColumn, always evaluate with daily data.
so with above code,
its today high, yest high and so on.
Intention on 15m TF, is to get current high, prev 15m high and so on.

Filter settings, all 3 tried, bar, 1 recent day and daily range.

Any suggestion? I also double checked the data, its 1m data for prev 5 days.

Say for eg. I want to explore
C > H AND (Ref(H, -1) > Ref(H, -2));
Try the function ------> TimeFrameGetPrice()
Chose parameters wisely for this function lest may look into future.
Example:
Get 15Mnt Bar High ------->
TimeFrameGetPrice( "H", in15Minute, -1 )
No need to use TimeFrameSet() & TimeFrameRestore() if your only requirement is to find 15mnt High.
 

travi

Well-Known Member
Try the function ------> TimeFrameGetPrice()
Chose parameters wisely for this function lest may look into future.
Example:
Get 15Mnt Bar High ------->
TimeFrameGetPrice( "H", in15Minute, -1 )
No need to use TimeFrameSet() & TimeFrameRestore() if your only requirement is to find 15mnt High.
Sorry forgot to mention that, I've tried that as well, it didn't work.
 

travi

Well-Known Member
Hope u havn't forgotten dat:
1. The Original data TF should be IEOD or of TF less than 15 mnt.
2. In Explore /Analysis window ------> Settings --------> Periodicity -----> ur Base TF which should be less than 15 mnt.
Damn, thank you very much.

The 2nd suggestion worked :thumb:

EDIT:
anyway, test code I was using was this
Code:
_SECTION_BEGIN("Tester");
	/*
	TimeFrameSet(in15Minute);
	va1 = Ref(H,1);
	va2 = Ref(H,-1);
	va3 = Ref(H,-2);
	va4 = Ref(H,-3);*/
	
	/*
	va1 = TimeFrameGetPrice("H",in15Minute,1); //Ref(H,1);
	va2 = TimeFrameGetPrice("H",in15Minute,-1); //Ref(H,-1);
	va3 = TimeFrameGetPrice("H",in15Minute,-2); //Ref(H,-2);
	va4 = TimeFrameGetPrice("H",in15Minute,-3); //Ref(H,-3);
	*/
	
	TimeFrameSet(in15Minute);
	va1 = H;
	va2 = Ref(Va1,-1);
	va3 = Ref(va1,-2);
	va4 = Ref(va1,-3);
	
	Filter = 1;

	AddColumn(Ref(va1,1),"va1",1.2);
	AddColumn(Ref(va2,1),"va2",1.2);
	AddColumn(Ref(va3,1),"va3",1.2);
	AddColumn(Ref(va4,1),"va4",1.2);

_SECTION_END();
 
Last edited:

john302928

Well-Known Member
Hi

if ( NewPeriod )
{
GfxSelectSolidBrush( colorYellow );
GfxSelectPen( colorYellow, 2 );
Say( "hi its a New period" );
}
This is the code that gives me alert whenever new period occurs
but if i apply the same syntax for golden cross alert, afl shows error


goldencross= Cross(MA1, MA2); //moving average bullish
if ( goldencross )
{

Say( "hi its a goldencross" );
}

Can anyone please help me on this. Thanks
 

Similar threads