Simple Coding Help - No Promise.

xsis

Active Member
@extremeist bro - i am a novice in trading and noob in programming/coding unlike U. but atleast i came to know frm experts in this field that amibroker is incapable of handling tick data and bid/ask, thus u dont find a single afl code on this on www :mad:

this is just out of curiosity to know what it wud be like :( m trying to learn afl language by bits and pieces!!

can you help :confused:

first would u plz tell us how ur getting Bid and ask in amibroker?
 

Cubt

Algo Trader
Guys,..
Any ways to trigger sms from amibroker? ? Am getting mails from amibroker whenever signals r generated but any ways to send sms??
 
Guys,..
Any ways to trigger sms from amibroker? ? Am getting mails from amibroker whenever signals r generated but any ways to send sms??
http://www.tradesender.com/

u can download the tradesender application and after some easy steps u can get buy sell messages to ur mobile phone. when i downloaded and tried this software its just amazing. within sec u get ur buy sell signals on phone as messages. no need to stay infront of screen all day. u can go to party and trade on phone :) . the best part is u have 300 messages free per month and its enough for me.. so no need to pay and if u want more i think its 150 per month but 300 messages are enough for me. this software works very well and online support is very helpful.
 

Cubt

Algo Trader
http://www.tradesender.com/

u can download the tradesender application and after some easy steps u can get buy sell messages to ur mobile phone. when i downloaded and tried this software its just amazing. within sec u get ur buy sell signals on phone as messages. no need to stay infront of screen all day. u can go to party and trade on phone :) . the best part is u have 300 messages free per month and its enough for me.. so no need to pay and if u want more i think its 150 per month but 300 messages are enough for me. this software works very well and online support is very helpful.
Yes I have this software but not tested it. I have downloaded their mobile apps n configured my desktop client as well. We get msgs in mobile app not by normal text sms right??
 
Yes I have this software but not tested it. I have downloaded their mobile apps n configured my desktop client as well. We get msgs in mobile app not by normal text sms right??
yes u have to connected to net to get msgs in mobile app. its right.. i am using this every day and its working very fine. app messages contains buy and sell price and candle close time. short cover signals also updated fine. but yes it does not send direct messages to ur cell phone..
 

Nehal_s143

Well-Known Member
Congrats to all, thread has completed 100 pages :clap: :clap: :clap: :thumb: :clapping: :clapping: :clapping:

Below request re-posting..... please help :)

I am using below P&F afl, box size used in below afl is ok for Nifty but if used on Copper and Gold, due to wrong box size Chart becomes of no use.

I was reading ebook on P&F which says




Please box size to be used for copper and gold also how to use 2% instead of
boxsize=IIf(C<0.05, 0.001,
IIf(C>=0.05 AND C<0.1, 0.002,
IIf(C>=0.1 AND C<0.5, 0.005,
IIf(C>=0.5 AND C<2, 0.01,
IIf(C>=2 AND C<5, 0.02,
IIf(C>=5 AND C<10, 0.05,
IIf(C>=10 AND C<50, 0.1,
IIf(C>=50 AND C<100, 0.2,
IIf(C>=100 AND C<200, 0.5,
IIf(C>=200 AND C<500, 1,
2 ))))))))));

or any other suggestion so that same P&F afl can be used for all type of stocks


// dont trail stop loss in range bound market, keep recent high/low as stop loss
// re-entry as P&F signal in same direction after fake opposite signal
_SECTION_BEGIN("Point and Figure1");
//AFL P&F Chart for Amibroker Indicator window. Based on High/low prices.
//Based on code in AB help files
//Reverse is 3 boxes.

SetBarsRequired(100000,100000);

//Size for P&F boxes
boxsize=IIf(C<0.05, 0.001,
IIf(C>=0.05 AND C<0.1, 0.002,
IIf(C>=0.1 AND C<0.5, 0.005,
IIf(C>=0.5 AND C<2, 0.01,
IIf(C>=2 AND C<5, 0.02,
IIf(C>=5 AND C<10, 0.05,
IIf(C>=10 AND C<50, 0.1,
IIf(C>=50 AND C<100, 0.2,
IIf(C>=100 AND C<200, 0.5,
IIf(C>=200 AND C<500, 1,
2 ))))))))));
Box = LastValue(boxsize);
HX = round((H/box)*10)/10;
LX = round((L/box)*10)/10;
RH = floor(HX);
FL = ceil(LX);


// initialize first element
j = 0;

Reverse = 3; // reversal requirement

PFC[j] = FL[0];
PFO[j] = PFC[j] + 1;
down = 1; // By default the first bar is a down bar.
up = 0;
swap = 0;

// perform the loop that produces PF Chart
for( i = 1; i < BarCount; i++ )
{

if( FL <= PFC[j]-1 && down) //continue down
{
PFC[j] = FL;
PFO[j] = PFC[j] + 1;
}
else
{
if( RH >= PFC[j] + Reverse && down) //Change direction to up
{
j++;
swap = 1;
PFC[j] = RH;
PFO[j] = PFC[j]-1;
}
}
if( RH >= PFC[j] + 1 && up) //Continue up
{
PFC[j] = RH;
PFO[j] = PFC[j] - 1;
}
else
{
if( FL <= PFC[j] - Reverse && up) //Change direction to down
{
j++;
PFC[j] = FL;
PFO[j] = PFC[j] + 1;
swap = 1;
}
}
if( swap )
{
swap = 0;
if( up )
{
up = 0;
down = 1;
}
else
{
up = 1;
down = 0;
}
}
}
delta = BarCount - j-1;


PFO = Ref( PFO, -delta );
PFC = Ref( PFC, -delta );

// High-Low range sets the height of the P&F bar
H = IIf(Ref(PFC,-1)>Ref(PFO,-1),Ref(HHV(PFC,1),-1)-1,Max(PFO,PFC))*Box;
L = IIf(Ref(PFC,-1)<Ref(PFO,-1),Ref(LLV(PFC,1),-1)+1,Min(PFO,PFC))*Box;
O =
IIf(Ref(PFC,-1)>Ref(PFO,-1),Ref(HHV(PFC,1),-1)-1,IIf(Ref(PFC,-1)<Ref(PFO,-1),Ref(LLV(PFC,1),-1)+1,PFO))*Box;

// the difference between Open AND Close should be set to box size
// the sign decides if X or O are plotted
C = O + Box * IIf( PFC > PFO, 1,-1);




GraphXSpace = 2;
Title ="" + Name()+ " PF H: " + H+ ", L: " + L+", Box: "+ box
+ ", Reversal: " + reverse;

Plot( C, "P&F Chart Close", IIf( PFC > PFO, colorBlue, colorRed ),styleCandle+styleNoLabel+stylePointAndFigure);

hbar1 = H ;
hbar2 = Ref(H,-2) ;
lbar1 = L ;
lbar2 = Ref(L,-2) ;
Buy = IIf( hbar1 > hbar2 AND PFC > PFO ,True,False);
Sell = IIf(lbar1 < lbar2 AND PFC < PFO ,True,False);


Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );

PlotShapes(shapeSmallUpTriangle * Buy, colorGreen, 0, L -2);
PlotShapes(shapeSmallDownTriangle * Sell, colorOrange, 0, H -2);


_SECTION_END();
 

pratapvb

Well-Known Member
just change the last 2 to 2%

IIf(C>=200 AND C<500, 1,
2 ))))))))));

so change this to

IIf(C>=200 AND C<500, 1,
C*0.02 ))))))))));

you can round off appropriately

or you can have a complete dynamic boxsize by just saying

boxsize = c * 0.02 ;
 
Last edited:

manishchan

Well-Known Member
Nice Thread and Great Job !!

Happy Singh Ji / Pratapbhai : Is it possible to plot HTF indicator on smaller TF with the value of HTF ? Ex : Plotting stoch of 5 min on 1 min chart but stoch still showing values and lines of 5 min.
 

pratapvb

Well-Known Member
Nice Thread and Great Job !!

Happy Singh Ji / Pratapbhai : Is it possible to plot HTF indicator on smaller TF with the value of HTF ? Ex : Plotting stoch of 5 min on 1 min chart but stoch still showing values and lines of 5 min.
yes possible

I had shared MACD code here to show of higher TF
 

Similar threads