Thursday, August 6, 2009

Chat Room

I get email from time to time and have found it frustrating and difficult to solve a problem or have a healthy discussion via email. I've added a link to a chat room where we can have a discussion. If you want to chat about whatever, put a comment up on one of the posts and suggest a time. I'd like to chat about using Bracket Trader, or the advantages of using MetaTrader over Amibroker with IB (I know there are issues with that set up)

Look at the side bar on the right there is a title "Forex Hit List". I've added a link to a chat room.

Wednesday, August 5, 2009

Tipster Trendlines 2.12

Tipster Trendlines UPDATE HERE

Go to the Tipster Trendlines 2.1 post for additional information on how to obtain this AFL code. Don't make any more manual entry mistakes!

In addition, you may want to check the "
Tipster Trendlines" TAGS on the the right of the blog to see all post about this code (or click this link).

Another update to the AFL, Tipster Trendlines, for trading right from the Amibroker chart. Here are the two additions;

Description (code follows below)

1. This addition will add "seconds remaining in bar" to the title of the chart. Good for intraday trading.

2. This addition will tell you if the last daily bar has the same date as today. Have you ever downloaded your EOD data and placed orders based on old data, assuming that you have the latest quotes? This won't prevent that but it will show a warning in the title of the chart so you have a chance!
AFL CODE
Put this code at the top of the AFL, right after SetChartOptions(0,chartShowArrowschartShowDateschartWrapTitle); function secondsLeftOnBar_func()
{
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
TimeFrame = Interval();
Newperiod = SecondNum % TimeFrame == 0;
SecsLeft = SecondNum - int( SecondNum / TimeFrame ) * TimeFrame;
SecsToGo = TimeFrame - SecsLeft;
return SecsToGo;
}


Replace the Ttle section at the bottom with this code
//Check if daily data is from today
DownloadDate = LastValue(DateNum());
TodayDate = Now(3);
if(LastValue(DownloadDate) != TodayDate)
BarDateError = " *WARNING: Data NOT Current*";
else
BarDateError ="";

Title = EncodeColor(colorLightBlue) + Name() + " " + FullName() +
EncodeColor(colorLightBlue) + " - " + Date() +
EncodeColor(colorBlue) + " O=" + O +
EncodeColor(colorLime) + " H=" + H +
EncodeColor(colorRed) +" L=" + L +
EncodeColor(colorBlue) + " C=" + C +
EncodeColor(colorYellow) + " ATR: " + Prec(ATR(6),4) +
EncodeColor(colorDarkYellow) + " Seconds Remaining: " + secondsLeftOnBar_func() +
EncodeColor(colorWhite) + BarDateError;
_SECTION_END();

Enjoy!

Sunday, August 2, 2009

Tipster Trendlines 2.11



This page is out of date, click "Tipster Trendlines" at the top of the page.


Go to the Tipster Trendlines 2.1 post for additional information on how to obtain this AFL code. Don't make any more manual entry mistakes!

Several readers have donated and received the Tipster Trendlines 2.1 (TT) AFL. A few things have come up, and I want to share the questions and code fixes.

CODE FIX
This fixes an issue where TWS rejects the submitted prices when TT is set for "Futures" trading.
Search for the red text below using the find box and replace with the code below. The NEW code is in blue. If you can't figure this out, let me know by comment or email.

if(Length == "0")
{
BS = int( BS ); // this truncates whatever is after the decimal
TA = int( TA );
ST = int( ST );
IBTarget = NumToStr( TA, 1.0, 0);
IBOrder = NumToStr( BS, 1.0, 0);
IBStop = NumToStr( ST, 1.0, 0);

}

VISTA

Microsoft VISTA continues to be a problem for Amibroker. The Interpretation window should be closed according to Ami support. The issue has not been resolved at this time, stay tuned in the Yahoo Amibroker groups. The reports I am receiving indicate the the TT screen "flashes" when Auto Trading is turned on.

Here is some code added by Rick. This code flashes the screen at the start and end of the trading day. Adjust the time as required:


Plot(TimeNum() == 092959, "",colorPaleGreen,styleHistogramstyleDashedstyleOwnScalestyleNoLabel);
Plot(TimeNum() == 155959, "",colorRed,styleHistogramstyleDashedstyleOwnScalestyleNoLabel);

(In Preferences - Intraday, "Time stamp of compressed intraday bars shows - "END time of interval")

Questions and answers

Q1. can make change to stop loss and target profit or not so that I can move my stop loss/target after the trade is entered.

A1. No. Once the order is placed and not filled, cancel and re-do in Amibroker. Once the order is placed and filled, move stops and targets in TWS.

Q2. Also if I used stop + limited price to enter trade, the trade may or may not be able to be filled. Can we see the trade has been filled in the status of Amibroker panel or not without going to IB pages?

A2. No. This is possible but I have not coded it. I had that feature in an earlier version.

Other Issues
Lastly, I would appreciate any feedback on this code posted as comments so other potential users can see the value. If current users have any suggestions, of issues with the AFL please let me know and we will remedy.

Disclaimer

The information presented on this site is for educational and entertainment purposes only. This site contains no suggestions or instructions that you must follow, do your own research and due diligence before committing your cash to the markets. Your on your own.