Simple Coding Help - No Promise.

hello

i am attaching an afl which plots and scans following conditions

buy= after 3 candles closed with higher highs and higher lows

sell=after 3 candles with lower high and lower lows

PHP:
Buy = (H > Ref(H,-1)) AND (Ref(H,-1) > Ref(H,-2)) AND (L > Ref(L,-1)) AND (Ref(L,-1) > Ref(L,-2)); 
Sell = (H < Ref(H,-1)) AND (Ref(H,-1) < Ref(H,-2)) AND (L < Ref(L,-1)) AND (Ref(L,-1) < Ref(L,-2)); 

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

PlotShapes(IIf(Buy, shapeupArrow,shapeNone),colorGreen,0,L,-15); 
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,-15); 
Plot(C,"Close",Colordefault,64); 
Filter=Buy OR Sell ; 
AddColumn(C,"Close",1.2); 
AddColumn(Buy,"Buy Triggered",1); 
AddColumn(sell,"Sell Triggered",1);

need a param option in the above afl to change from 3 to 5 or any other day of the choice
 
Logging started for 'C:\Users\user\Desktop\NIFTY50_2014\NIFTY50_DEC2014\ACC.txt' file, using format definition file 'Formats\default.format'

Error in line ACC,20141201,09:17,1472.75,1476.90,1472.20,1474.50,2441
Invalid date format/value

1) I created empty database
2) then tried to "import ASCII" csv file into it...I am getting this error ..."is "09:17" not correct time format? do i need to change some settings in ambibroker?
Go to C:\Program Files\AmiBroker\Formats folder

You will see plenty of *.format files in there.

Make a copy of default.format and call the new file intime.format
open intime.format in notepad and you will see a line that will start with
$FORMAT, for e.g.

$FORMAT TICKER,Date_DMY,Open,High,Low,Close,Volume
Replace it with
$FORMAT TICKER,Date_YMD,Time,Open,High,Low,Close,Volume
When you import the file again, make sure that on the dialog box where you choose import data file, drop down box next to label "Files of Type" shows intime (*.*)

Its fairly common sense approach ... AmiBroker does have help to show you all the words that it recognizes in format file.... When testing a format file, import data into a dummy ticker and/or keep only one or two lines of data to avoid deletion headache.
 
Go to C:\Program Files\AmiBroker\Formats folder

You will see plenty of *.format files in there.

Make a copy of default.format and call the new file intime.format
open intime.format in notepad and you will see a line that will start with
$FORMAT, for e.g.



Replace it with


When you import the file again, make sure that on the dialog box where you choose import data file, drop down box next to label "Files of Type" shows intime (*.*)

Its fairly common sense approach ... AmiBroker does have help to show you all the words that it recognizes in format file.... When testing a format file, import data into a dummy ticker and/or keep only one or two lines of data to avoid deletion headache.

Sir,
Im using Shankar/Josh's utility RTDMAN(v1.21) for tick data - cud u pls guide me to get Ask/Bid quotes in place of and/or in addition to LTP ?
Thank u
Shiraj
 
Last edited:

amitrandive

Well-Known Member
hello

i am attaching an afl which plots and scans following conditions

buy= after 3 candles closed with higher highs and higher lows

sell=after 3 candles with lower high and lower lows

PHP:
Buy = (H > Ref(H,-1)) AND (Ref(H,-1) > Ref(H,-2)) AND (L > Ref(L,-1)) AND (Ref(L,-1) > Ref(L,-2)); 
Sell = (H < Ref(H,-1)) AND (Ref(H,-1) < Ref(H,-2)) AND (L < Ref(L,-1)) AND (Ref(L,-1) < Ref(L,-2)); 

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

PlotShapes(IIf(Buy, shapeupArrow,shapeNone),colorGreen,0,L,-15); 
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,-15); 
Plot(C,"Close",Colordefault,64); 
Filter=Buy OR Sell ; 
AddColumn(C,"Close",1.2); 
AddColumn(Buy,"Buy Triggered",1); 
AddColumn(sell,"Sell Triggered",1);

need a param option in the above afl to change from 3 to 5 or any other day of the choice
This should work'

Code:
n= Param("No.of Bars",-1,-1,100,1);
m=Param("No of Earlier Bars",-1,-1,100,1);
Buy = (H > Ref(H,n)) AND (Ref(H,n) > Ref(H,m)) AND (L > Ref(L,n)) AND (Ref(L,n) > Ref(L,m)); 
Sell = (H < Ref(H,n)) AND (Ref(H,n) < Ref(H,m)) AND (L < Ref(L,n)) AND (Ref(L,n) < Ref(L,m)); 

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

PlotShapes(IIf(Buy, shapeUpArrow,shapeNone),colorGreen,0,L,-15); 
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,-15); 
Plot(C,"Close",colorDefault,64); 
Filter=Buy OR Sell ; 
AddColumn(C,"Close",1.2); 
AddColumn(Buy,"Buy Triggered",1); 
AddColumn(Sell,"Sell Triggered",1);
 
Sir,
Im using Shankar/Josh's utility RTDMAN(v1.21) for tick data - cud u pls guide me to get Ask/Bid quotes in place of and/or in addition to LTP ?
Thank u
Shiraj
I am sorry but I have no idea about RTDMAN or its data. Did you try keywords "Bid" and "Ask" in the format file? AmiBroker is very intuitive and straight-forward in its approach that way.

Also, How many days of Tick data and for how many scrips are you planning to load AmiBroker? Anything above one month will be a disaster !!! If you must handle tick data, use NinjaTrader
 
Also, How many days of Tick data and for how many scrips are you planning to load AmiBroker? Anything above one month will be a disaster !!! If you must handle tick data, use NinjaTrader
What are you talking about? I can load multiple months of tick without problems. In fact it is prepared to load hundreds of millions of bars.

Besides it is advised to use 64-bit Amibroker for large data sets.
 
I am sorry but I have no idea about RTDMAN or its data. Did you try keywords "Bid" and "Ask" in the format file? AmiBroker is very intuitive and straight-forward in its approach that way.

Also, How many days of Tick data and for how many scrips are you planning to load AmiBroker? Anything above one month will be a disaster !!! If you must handle tick data, use NinjaTrader


Thank u Mastermind ,

RTDMAN is an awesome free utility developed by TraderJi members to port RTdata from NEST/NOW to Ami (very handy for a novice like me ).

trying my hand at very few Scrips mainly NFO n some MCX scrips.

Im very new to TechAnlysTrading and starving to learn, trying evrything and doing nothing !!!

Being a script illiterate , i found AFL somewhat digestible, will defintly look into NinjaTrader.

Thank u again for ur guidance and will need a lot more of dat ahead.

shiraj

Edit: im not sure i understood correctly ur following instruction:
Did you try keywords "Bid" and "Ask" in the format file? AmiBroker is very intuitive and straight-forward in its approach that way.
 
Last edited:
What are you talking about? I can load multiple months of tick without problems. In fact it is prepared to load hundreds of millions of bars.

Besides it is advised to use 64-bit Amibroker for large data sets.
Hmmm!!

Thank you very much for correcting this.

Please share the exact version number, machine config and number of tickers you are using. Also if you can share the article/the link about large data sets?

I have to admit that its been a while since i attempted this on Amibroker 5.5 and for about 350 Symbols and I don't think the machine was 64 bit then.

What I do remember is that Ami had accepted tick data for about a month without any problems but then it badly (badly!!) slowed down. I had to delete the whole database and reload it with 1 min data.

Further to my own experience, most of the third party commercial data feed providers also do not push tick data into Ami so I put 2+2 together...
 

Similar threads