Simple Coding Help - No Promise.

trash

Well-Known Member
Dear All

AFL for Stochastic crossover.

I need the arrows to be at the exact crossover locations as shown in the sketch.

Also is there any way to increase the arrow size?
Code:
PlotShapes( IIf( Sell, shapeDownTriangle, shapeNone ), colorRed, 0, p1, offset = -15 );
PlotShapes( IIf( Buy, shapeUpTriangle, shapeNone ), colorBlue, 0, p1, Offset = -15 );
As for size plotshapes has no size parameter but different shapes. But in new beta version of AB you can use webdings and wingdings 1 to 3 and change size of it. New function PlotTextSetFont()

Code:
for ( i = 2; i < BarCount; i++ )
{
    if ( Buy[i] )
        PlotTextSetFont( "C", "Wingdings", size = 30, x = i - 1, y = p1[i], colorGreen, colorDefault, offset = -(size+10) );

    if ( Sell[i] )
        PlotText( "D",  x = i - 2, y = p1[i], colorRed, colorDefault, offset = 10 ); // will use new font too
}
example will look like this one



webdings and wingdings codes
 
Last edited:

pratapvb

Well-Known Member
Dear All

AFL for Stochastic crossover.

I need the arrows to be at the exact crossover locations as shown in the sketch.

Also is there any way to increase the arrow size?




Code:
_SECTION_BEGIN("StochasticsSmooth");
grid_day = IIf(Day()!=Ref(Day(),-1),1,0);  
Plot(grid_day,"",colorDarkGrey,styleHistogram|styleDashed|styleNoLabel|styleOwnScale);
 
SetChartOptions(0,chartShowArrows|chartShowDates);
d1=StochK(18, 9);//, 18) ;
d2=StochD(18,9,3);//, 20);
qw=WMA(d1, 1); wq=WMA(d2, 1);
ww=WMA(qw, 2); ee=WMA(wq, 2);
p1=WMA(ww, 3); p2=WMA(ee, 3);
Plot(p1, "price", colorGreen,styleThick);
Plot(p2, "price", colorRed,styleThick);
 
Overbought = 80 ;
Oversold =20 ;
Center = 50 ;
 
Plot(Overbought, "",colorRed,styleThick) ;
Plot(Oversold, "",colorGreen,styleThick) ;
Plot(Center, "",colorBlue, styleDashed,styleThick) ;
Buy=Cross(p1, p2)  ;
Sell=Cross(p2, p1) ;
PlotShapes(IIf( Sell, shapeDownArrow , shapeNone), colorRed,0, offset =25) ;
PlotShapes(IIf( Buy, shapeUpArrow , shapeNone), colorBlue,0, Offset=50) ;
Cover=Buy; Short=Sell;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
 
 
BuyPrice=ValueWhen(Buy, C);
SellPrice=ValueWhen(Sell, C);
 
 
Filter=Buy OR Sell ;
 
 
                SetOption("NoDefaultColumns", True);
                AddTextColumn(Name(), "Symbol", 77, colorDefault, colorDefault, 120);
                AddColumn(DateTime(), "Trigger Date", formatDateTime);
 
 
 
                AddColumn(IIf(Buy, 66, 83), "Signal", formatChar, colorYellow, IIf(Buy, colorGreen, colorRed));
               AddColumn(IIf(Buy, BuyPrice, SellPrice),  "Entry", 6.2);
 AddColumn(LastValue(C), "Entry Price.", 6.2);
_SECTION_END();
PlotShapes(IIf( Sell, shapeDownArrow , shapeNone), colorRed,0, offset =25) ;
PlotShapes(IIf( Buy, shapeUpArrow , shapeNone), colorBlue,0, Offset=50) ;

your are missing one argument in the above between 0 and offset, use p1 or p2 (the value used for plotting) for that

PlotShapes(IIf( Sell, shapeDownArrow , shapeNone), colorRed,0, p1, offset =25) ;
PlotShapes(IIf( Buy, shapeUpArrow , shapeNone), colorBlue,0, p1, Offset=50) ;
 

KelvinHand

Well-Known Member
Code:
PlotShapes( IIf( Sell, shapeDownTriangle, shapeNone ), colorRed, 0, p1, offset = -15 );
PlotShapes( IIf( Buy, shapeUpTriangle, shapeNone ), colorBlue, 0, p1, Offset = -15 );
As for size plotshapes has no size parameter but different shapes. But in new beta version of AB you can use webdings and wingdings 1 to 3 and change size of it. New function PlotTextSetFont()

Code:
for ( i = 2; i < BarCount; i++ )
{
    if ( Buy[i] )
        PlotTextSetFont( "C", "Wingdings", size = 30, x = i - 1, y = p1[i], colorGreen, colorDefault, offset = -(size+10) );

    if ( Sell[i] )
        PlotText( "D",  x = i - 2, y = p1[i], colorRed, colorDefault, offset = 10 ); // will use new font too
}
example will look like this one



webdings and wingdings codes

Play around with these for old verion

SymbolSize= 20
GfxSelectFont("Wingdings", SymbolSize, 500 );

GfxSetBkMode(1);
GfxSetTextColor( colorRed );
GfxTextOut("C", 100, 100 ); => locate the ConvertYtoPixel() n ConvertXtoPixel()
GfxSetTextColor( colorGreen);
GfxTextOut("D", 150, 100 );
GfxSelectFont("Tahoma", 20, 500 );
 

amitrandive

Well-Known Member
Code:
PlotShapes( IIf( Sell, shapeDownTriangle, shapeNone ), colorRed, 0, p1, offset = -15 );
PlotShapes( IIf( Buy, shapeUpTriangle, shapeNone ), colorBlue, 0, p1, Offset = -15 );
As for size plotshapes has no size parameter but different shapes. But in new beta version of AB you can use webdings and wingdings 1 to 3 and change size of it. New function PlotTextSetFont()

Code:
for ( i = 2; i < BarCount; i++ )
{
    if ( Buy[i] )
        PlotTextSetFont( "C", "Wingdings", size = 30, x = i - 1, y = p1[i], colorGreen, colorDefault, offset = -(size+10) );

    if ( Sell[i] )
        PlotText( "D",  x = i - 2, y = p1[i], colorRed, colorDefault, offset = 10 ); // will use new font too
}
example will look like this one



webdings and wingdings codes
Trash
Thanks for the solution and heads up info on new version of AB with fonts.
:clapping:
 

amitrandive

Well-Known Member
PlotShapes(IIf( Sell, shapeDownArrow , shapeNone), colorRed,0, offset =25) ;
PlotShapes(IIf( Buy, shapeUpArrow , shapeNone), colorBlue,0, Offset=50) ;

your are missing one argument in the above between 0 and offset, use p1 or p2 (the value used for plotting) for that

PlotShapes(IIf( Sell, shapeDownArrow , shapeNone), colorRed,0, p1, offset =25) ;
PlotShapes(IIf( Buy, shapeUpArrow , shapeNone), colorBlue,0, p1, Offset=50) ;
Thanks Pratap Sir for your help.
:clapping:
 

amitrandive

Well-Known Member
Play around with these for old verion

SymbolSize= 20
GfxSelectFont("Wingdings", SymbolSize, 500 );

GfxSetBkMode(1);
GfxSetTextColor( colorRed );
GfxTextOut("C", 100, 100 ); => locate the ConvertYtoPixel() n ConvertXtoPixel()
GfxSetTextColor( colorGreen);
GfxTextOut("D", 150, 100 );
GfxSelectFont("Tahoma", 20, 500 );
KelvinHand
Thanks for providing this solution for the old version of AB.
:clapping:
 
can anyone help please

Conditions

Buy above 1 = 15 deg Gann res from (Prev Day High + Prev day Low )/2
Sell below 1 = 15 deg Gann sup from (Prev Day High + Prev day Low )/2

If Current Day Open > Buy above 1

Buy above 2 = 30 deg res from (Prev Day High + Prev day Low )/2
Sell below 2 = 15 deg sup from (Current Day High)

If Current Day Open < Sell below 1

Buy above 3 = 15 deg res from (Current Day Low )
Sell below 3 = 30 deg sup from (Prev Day High + Prev day Low )/2



Trailing Stoploss for Buy above = 15 deg sup from (Current Day High)
Trailing Stoploss for Sell below = 15 deg res from (Current Day Low)

Please try to code this
Buy Above ,sell below and trailing stoploss levels should be plotted in a side Box
Trailing stoploss should be plotted in graph also

Regards Renjith


gann formulae

Pivot =(Prvious Day High + Prv Day Low)/2

15 deg res = (sqrt(Pivot)+0.083333)^2
15 deg Sup =(sqrt(Pivot)-0.083333)^2
 

a1b1trader

Well-Known Member
Hi

Facing an error in amibroker

CMemory Exception in AddqQuotationInt () - you have run out of memory

What should I do

Thanks
Thanks Amit for providing links for solution.

I tried for the following solution

To avoid running out of memory, go to Tools->Preferences, "Data" and decrease the size of in-memory cache. To set it to minimum, enter "11" (eleven) into "in-memory cache (max. symbols)".

What should be the right value for this cache.

When I tried to change the value from 10000 (default value) to 1000.
A confirmation asking pop up appeared, that says

"you have change data cache settings. Do you want to flush quotation center to apply the change right now."

I did not press yes, as I do not know what it will do. So please let me know what it will do. Will it delete some data of it own.

Or there is any easy way to solve this problem

Further I have some tickers in 1 min data in my database for say last 2 years that I want to change/replace with eod data for last 18 months. Can I do it without any problem. Can I save EOD data files in IEOD data settings. What should be the steps to do it. I just do not want to do something, that I do not know, as I have a big database (though I want to reduce it in size)

Thanks
Hi

I am facing above problem
Need your help to solve this memory problem.

Thanks
 

a1b1trader

Well-Known Member
Further I have some tickers in 1 min data in my database for say last 2 years that I want to change/replace with eod data for last 18 months. Can I do it without any problem. Can I save EOD data files in IEOD data settings. What should be the steps to do it. I just do not want to do something, that I do not know, as I have a big database (though I want to reduce it in size)


I tried to feed following EOD data to Amibroker configured for IEOD

<Ticker>,<Date>,<Time>,<Open>,<High>,<Low>,<Close>,<Volume>
AARTIIND,20131101,00:00,79.60,80.00,78.10,78.75,8737,0
AARTIIND,20131103,00:00,79.05,82.00,79.00,81.05,9160,0
AARTIIND,20131105,00:00,83.70,83.70,79.00,82.30,12642,0
AARTIIND,20131106,00:00,84.95,84.95,80.00,80.45,5769,0
AARTIIND,20131107,00:00,81.00,82.60,81.00,81.95,4672,0
AARTIIND,20131108,00:00,82.00,82.50,80.00,80.65,6234,0
AARTIIND,20131111,00:00,80.75,82.65,78.65,81.85,7822,0
AARTIIND,20131112,00:00,81.50,83.00,81.00,81.10,6194,0
AARTIIND,20131113,00:00,80.70,82.25,80.05,80.70,3978,0
AARTIIND,20131114,00:00,80.30,92.50,80.00,88.15,88821,0
AARTIIND,20131118,00:00,91.80,91.90,89.05,89.70,47552,0
AARTIIND,20131119,00:00,89.55,89.55,85.10,85.45,19094,0
AARTIIND,20131120,00:00,85.10,88.85,85.10,86.05,15893,0
AARTIIND,20131121,00:00,86.85,86.85,82.70,83.25,13544,0
AARTIIND,20131122,00:00,83.60,84.20,82.50,83.10,3957,0
AARTIIND,20131125,00:00,83.50,85.00,82.65,84.35,11832,0
AARTIIND,20131126,00:00,85.00,86.75,84.20,86.15,16751,0
AARTIIND,20131127,00:00,86.50,86.50,83.10,84.40,4155,0
AARTIIND,20131128,00:00,85.00,85.00,81.00,83.35,12661,0
AARTIIND,20131129,00:00,85.70,85.70,82.45,84.40,3676,0


Though I can see this data in quotation editor but not in chart in candle form

The error is

Not enough data available
To plot any chart atleast 3 data bars are needed, but there are only 0 bars in 'AARTIND'

Please provide some solution

Thanks
 

extremist

Well-Known Member
@a1b1trader

no u can not expand the data u have in EOD format to IEOD format.

simple thing is tht how come the software will make the intermediate time stamped data?
it is impossible to do this.
on the other hand u can get eod out of ieod. and i hope u might be getting tht.
 

Similar threads