Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

bharatk8

Members
  • Content Count

    39
  • Joined

  • Last visited

Everything posted by bharatk8

  1. Hi After all sort of experiments,view of chart has improved to some extent.But I think i should go for "ZOOM RECENT BARS".This feature is available in several softwares/terminals.May I have code for it?
  2. Pl. see image. Chart on left is a view of my original AFL with styleNoReScale.I have changed yaxis parameters(minimum/maximum values of yaxis) for proper view. Chart on right is a view of AFL with styleOwnScale.This AFL gives a view which is easy on eye and I do not need to change yaxis parameters for view. But on close inspection,it becomes apparent that,MTF lines and cloud plots are not positioned correctly with reference to close of candle. Pl. help LAST TRY.txt
  3. I have tried following options mentioned in manual.But I have not received desired view.I have to keep adjusting Yaxis values in parameter window otherwise sometimes I can can hardly see candle.(see image)Pl. suggest necessary tweaking options. Code 1: mid1 = WMA( C, Period1 ); sd1 = StDev( C, Period1 ); Top1 = mid1 + Width1 * sd1; Bot1 = mid1 - Width1 * sd1; minimum = HighestVisibleValue( .99 * Bot1 ); maximum = LowestVisibleValue( 1.01 * Top1 ); HHm = ( TimeFrameGetPrice( "H", inMonthly, -1 ) ) ; Plot( HHm, "High", colorBlack, styleDots, Minimum, Maximum); Code 2: Plot(IIf(HHm< HighestVisibleValue(Top1) AND HHm > LowestVisibleValue(Bot1),LL,Null ) , "HHm", colorBlack, styleLine | styleDots | styleThick ); P.S.I am not able to upload code due to some uploading issue.
  4. bumping................................................................
  5. Hi My code has Monthly,Weekly,Daily MTF lines.These MTF lines compress chart view.I have tried various scale options to correct this but theses attempts have failed to deliver desired results.Pl. suggest ways to plot only those MTF lines which are close to(40 pips below/above) current bar only. _SECTION_BEGIN( "Monthly BB" ); TFm = inMonthly ; TimeFrameSet( TFm ); ShowBBm9F = ParamToggle( "BB9 MTFm F", "Hide|Show", 1 ); ShowBBm9L = ParamToggle( "BB9 MTFm L", "Hide|Show", 1 ); PMTFm9 = Param( "Periom9 MTFm", 9, 2, 30, 1 ); WMTFm9 = Param( "Width9 MTFm", 1.5, 0, 10, 0.05 ); ShowBBm20F = ParamToggle( "BB20 MTFm F", "Hide|Show", 1 ); ShowBBm20L = ParamToggle( "BB20 MTFm L", "Hide|Show", 1 ); PMTFm20 = Param( "Periom20 MTFm", 20, 2, 30, 1 ); WMTFm20 = Param( "Width20 MTFm", 2, 0, 10, 0.05 ); Mm9 = WMA( C, PMTFm9 ); sdm9 = StDev( C, PMTFm9 ); Topm9 = Mm9 + WMTFm9 * sdm9; Botm9 = Mm9 - WMTFm9 * sdm9; Mm20 = WMA( C, PMTFm20 ); sdm20 = StDev( C, PMTFm20 ); Topm20 = Mm20 + WMTFm20 * sdm20; Botm20 = Mm20 - WMTFm20 * sdm20; TimeFrameRestore(); Mm9Fm = TimeFrameExpand( Mm9, TFm, expandFirst ); TP9Fm = TimeFrameExpand( TOPm9, TFm, expandFirst ); BT9Fm = TimeFrameExpand( BOTm9, TFm, expandFirst ); Mm20Fm = TimeFrameExpand( Mm20, TFm, expandFirst ); TP20Fm = TimeFrameExpand( TOPm20, TFm, expandFirst ); BT20Fm = TimeFrameExpand( BOTm20, TFm, expandFirst ); Mm9lm = TimeFrameExpand( Mm9, TFm, expandLast ); TP9lm = TimeFrameExpand( TOPm9, TFm, expandLast ); BT9lm = TimeFrameExpand( BOTm9, TFm, expandLast ); Mm20lm = TimeFrameExpand( Mm20, TFm, expandLast ); TP20lm = TimeFrameExpand( TOPm20, TFm, expandLast ); BT20lm = TimeFrameExpand( BOTm20, TFm, expandLast ); if ( ShowBBm9F ) //Plot( Mm9Fm, "MID BANm9 monthly First", colorOrange, styleLine| styleDashed | styleNoRescale );//styleDots | if ( ShowBBm9F ) //Plot( TP9Fm, "TOP BANm9 monthly First", colorDarkRed, styleLine| styleDashed | styleNoRescale );//styleDots| if ( ShowBBm9F ) //Plot( BT9Fm, "BOT BANm9 monthly First", colorDarkOliveGreen, styleLine | styleDashed| styleNoRescale );//styleDots|styleDashed | if ( ShowBBm9L ) //Plot( Mm9lm, "MID BANm9 monthly Last", colorOrange, styleLine | styleDots | styleThick | styleNoRescale ); if ( ShowBBm9L ) //Plot( TP9lm, "TOP BANm9 monthly Last", colorOrange, styleLine | styleDots | styleThick | styleNoRescale ); if ( ShowBBm9L ) //Plot( BT9lm, "BOT BANm9 monthly Last", colorOrange, styleLine | styleDots | styleThick | styleNoRescale ); if ( ShowBBm20F ) //Plot( Mm20Fm, "MID BANm20 monthly First", colorBrown, styleLine | styleNoRescale );//styleDots | if ( ShowBBm20F ) //Plot( TP20Fm, "TOP BANm20 monthly First", colorBrown, styleLine | styleNoRescale ); if ( ShowBBm20F ) //Plot( BT20Fm, "BOT BANm20 monthly First", colorBrown, styleLine | styleNoRescale );//styleDots | if ( ShowBBm20L ) //Plot( Mm20lm, "MID BANm20 monthly Last", colorBrown, styleLine | styleDots | styleThick | styleNoRescale ); if ( ShowBBm20L ) //Plot( TP20lm, "TOP BANm20 monthly Last", colorBrown, styleLine | styleDots | styleThick | styleNoRescale ); if ( ShowBBm20L ) //Plot( BT20lm, "BOT BANm20 monthly Last", colorBrown, styleLine | styleDots | styleThick | styleNoRescale );
  6. Simulated Trading | eToke's Blog Simulated Trading 19apr09 I am very excited today as I have managed to complete something which has been on my to-do list for a very, very long time. A final push of inspiration from Dr. Brett’s new book, The Daily Trading Coach has allowed me to code up a simulator for my current Amibroker Setup. My issue with Simulated Trading in the past is simple: Using a demo account has an opportunity cost: It can only be used during market hours and I just cannot afford the time to spend actual market time in simulation mode. Ideally I want to be able to play-back many market hours of data during weekends and nights where I can practice my trading and ideas without wasting the little exposure to actual market time that I have. Amibroker has a great playback feature, which I have used for this purpose. An added bonus is the ability to playback at faster speeds in order to intensify and shorten the simulated session. I will touch on how I trade both automated system and discretionarily, in detail in later posts, but for now, I will simply say that I have up to now traded my (actual) discretionary trades on TWS through my Amibroker charts. Basically I have 5 buttons. In the past these have only fired orders in TWS. Now the chart can be switched to simulation mode where they create simulated orders : Complete Order: This will place a bracket order in TWS based on 3 horizontal “studïes” (lines on the chart which you can drag up and down in order to adjust the price level) – an entry, a stop and a target. Cancel: Will cancel any pending orders for the current symbol. Attach Bracket: Will attach a bracket order to the existing postion. Will do nothing if there is no open position. Buy and Sell: These will place a limit order at the last price traded. Have a small probability of not being executed, but I prefer it this way than having to pay the bid-ask spread. Pressing these buttons more than once in one direction will pyramid a trade. Close: Closes the current position. Will do nothing if there is no open position. Today I have done the following improvements to my existing code: 1 – I have finally taken the plunge to learn how GFX (Graphics programming on charts) in Amibroker works, and replaced the buttons (which used to be in the parameters window – Amibroker users will understand what I mean here). This is a great saver for screen real estate. 2 – I have added some code which will allow simulated trading. This works as follows: 1. The code will write each transaction (triggered by the buttons above) to a file identical in format to TWS’s executions.txt file. 2. An Excel Sheet (which I already have used for several years) reads this file and matches buys and sells together to create roundtrip trades and displays statistics. 3. The excel sheet also creates a “History file” in AFL which can be used to display past trades on the chart as well as be run in the backtester. This allows me to look at my trading performance using the metrics available in Amibroker. Points 2 and 3 I already used for my actual trading, but now I can use them to score my sessions on the “simulator”. Note: My position sizing is already coded into the system as a function of the ATR. I have learned not to mess about with position sizing a long time ago and nowadays my trading is simply a matter of pressing these buttons. The sizing changes depending on whether I am day trading or swing trading. This is set in the parameters window of the chart. Here are some screen shots of the setup: This is one of my charts. As indicated in my earlier post I have multiple timeframes on different charts at the same time. The control panel automatically appear only on the short term chart if I am trading using a day trade setup and position size or on the medium term chart when trading the swing setup and position size. The red and green dots indicate my simulated trades. This is the spreadsheet which does the trade matching: …and finally, here are the results for 11/09/2008 when run through the backtester: I have not posted the code for this on the blog because it is currently all over the place and is not really well packaged for distribution, however if you are interested in the code I can email it to you “as is”, with no guarantees it would work on your system! Later on, once I neaten up things a little I will start posting some code too. Feedback and comments would be very welcome! go to blog to find more info.
  7. I am looking for a backtesting simulator mentioned here, http://etoke.wordpress.com/2009/04/1...lated-trading/ If you have AFL similar to this one,pl. share.
  8. Today a company representative called me when I asked him about address of registered office and other information,he told that he has joined the company recently so he do not have any information.However he confirmed that he is operating Indian office from his residence.and at present only one trader is trading company fund live.It was also learnt that none of persons who had given testimonials were actually trading live.
  9. I saw a site named proptrader.in ,which was asking to pay for simulation and promising that after successful trial,I will be given funds to trade by Iceberg Capital LLC 1st firm did not have office address,2nd firm had an address but it was not traceable on google map.I asked to post correct addresses of firms as address of one firm was not traceable on google map.I also asked other details such as names of promoters/ownners/partners,year of formation of company, number of franchisees,total number of traders etc.But company told me that these are confidential details,and I have to contact their attorney and sign NDA to get this information. Information such as names of promoters/ownners/partners,year of formation of company, number of franchisees,total number of traders etc. are invariably mentioned by all prop. firms on their website. I fail to understand why they are not willing to disclose even trivial details such as company's correct addresses? Has anyone traded for this firm?Pl. share your experiences.
  10. If any one is/had been trading for http://icebergcapitalllc.com/contact.html,then share your views.Is it genuine?
  11. The manuals that come with the Amibroker have some sketchy tutorials, but nothing approaching a structured course so it’s a steep learning curve. Based on my limited experience of tinkering with AFLs, the best option in these cases seems to be to find some really well commented codes and start putting things together. Does anyone have any well commented trading systems written in AFL? I do not care whether they are useful systems or not
  12. a4360884;159898 It seems you have joined TL just to start flaming.BTW I have managed to find solution with help of a member.Forums are meeting point for like minded persons who want to help each other.If you do not have sharing spirit,stay away.If you have better options to enjoy what you like most go for it.because it is very clear that you do not fit in here.Do not bother to reply,I have put you on ignore list.
  13. This AFL (attached for ready reference) is used to record buy/sell/short/cover and get statistical results after exploration.in Amibroker It records Buy/Sell/Short/cover on chart correctly But in exploration,Long trades are missing(see image....missing long). Ticker signal array and AA settings are attached. pl. correct AFL. P.S. moderator is requested to move this thread to appropriate sub forum ControlPanelInclude-004.rar Missing longs.rar mmmm.rar NIFTY_F1~SignalArraysTestsignal.rar PaperTrading_V5_Parameters.rar
  14. _SECTION_BEGIN( "USING A TRADE COMPOSITE" ); function DeleteComposite( CompositeName ) { global Ticker; oAB = CreateObject( "Broker.Application" ); oStocks = oAB.Stocks(); oStocks.Remove( CompositeName ); oAB.RefreshAll(); } function AddTradeToComposite( Ticker, Action, LMTPrice ) { global Ticker; BI = BarIndex(); LBI = LastValue( BI ); if ( Action != "" ) { SignalArray = Nz( Foreign( Ticker + "~SignalArrays", "V", False ) ); BuyPriceArray = Nz( Foreign( Ticker + "~SignalArrays", "O", False ) ); SellPriceArray = Nz( Foreign( Ticker + "~SignalArrays", "H", False ) ); ShortPriceArray = Nz( Foreign( Ticker + "~SignalArrays", "L", False ) ); CoverPriceArray = Nz( Foreign( Ticker + "~SignalArrays", "C", False ) ); switch ( Action ) { case "BUY": SignalArray[LBI] = SignalArray[LBI] | 1; BuyPriceArray[LBI] = LMTPrice; break; case "SELL": SignalArray[LBI] = SignalArray[LBI] | 2; SellPriceArray[LBI] = LMTPrice; break; case "SHORT": SignalArray[LBI] = SignalArray[LBI] | 4; ShortPriceArray[LBI] = LMTPrice; break; case "COVER": SignalArray[LBI] = SignalArray[LBI] | 8; CoverPriceArray[LBI] = LMTPrice; break; case "REVLONG": SignalArray[LBI] = SignalArray[LBI] | 8 | 1; CoverPriceArray[LBI] = BuyPriceArray[LBI] = LMTPrice; break; case "REVSHORT": SignalArray[LBI] = SignalArray[LBI] | 2 | 4; SellPriceArray[LBI] = ShortPriceArray[LBI] = LMTPrice; break; } AddToComposite( SignalArray, Ticker + "~SignalArrays", "V", 7 | atcFlagEnableInIndicator ); AddToComposite( BuyPriceArray, Ticker + "~SignalArrays", "O", 7 | atcFlagEnableInIndicator ); AddToComposite( SellPriceArray, Ticker + "~SignalArrays", "H", 7 | atcFlagEnableInIndicator ); AddToComposite( ShortPriceArray, Ticker + "~SignalArrays", "L", 7 | atcFlagEnableInIndicator ); AddToComposite( CoverPriceArray, Ticker + "~SignalArrays", "C", 7 | atcFlagEnableInIndicator ); } } Ticker = Name(); Action = ""; if ( ParamTrigger( "Buy", "BUY" ) ) Action = "BUY"; if ( ParamTrigger( "Sell", "SELL" ) ) Action = "SELL"; if ( ParamTrigger( "Short", "SHORT" ) ) Action = "SHORT"; if ( ParamTrigger( "Cover", "COVER" ) ) Action = "COVER"; if ( ParamTrigger( "Reverse to Long", "REVLONG" ) ) Action = "REVLONG"; if ( ParamTrigger( "Reverse to Short", "REVSHORT" ) ) Action = "REVSHORT"; if ( ParamTrigger( "Delete Signal Compoiste", "DELETE" ) ) DeleteComposite( Ticker + "~SignalArrays" ); AddTradeToComposite( Ticker, Action, LastValue( Close ) ); RequestTimedRefresh( 0.1 ); if ( SetForeign( Ticker + "~SignalArrays" ) ) { SignalArray = Nz( Foreign( Ticker + "~SignalArrays", "V", False ) ); Buy = IIf( SignalArray & 1, 1, 0 ); Sell = IIf( SignalArray & 2, 1, 0 ); Short = IIf( SignalArray & 4, 1, 0 ); Cover = IIf( SignalArray & 8, 1, 0 ); BuyPrice = Nz( Foreign( Ticker + "~SignalArrays", "O" ) ); SellPrice = Nz( Foreign( Ticker + "~SignalArrays", "H" ) ); ShortPrice = Nz( Foreign( Ticker + "~SignalArrays", "L" ) ); CoverPrice = Nz( Foreign( Ticker + "~SignalArrays", "C" ) ); PlotShapes( IIf( Buy, shapeSmallUpTriangle, shapeNone ), 5, 0, BuyPrice, 0 ); PlotShapes( IIf( Sell, shapeSmallDownTriangle, shapeNone ), 4, 0, SellPrice, 0 ); PlotShapes( IIf( Short, shapeHollowDownTriangle, shapeNone ), 4, 0, ShortPrice, 0 ); PlotShapes( IIf( Cover, shapeHollowUpTriangle, shapeNone ), 5, 0, CoverPrice, 0 ); } RestorePriceArrays(); Plot( C, "", 1, 128 ); _SECTION_END();
  15. I am using a code to test my semi mechanical trading system. This code marks buy/sell/short/cover arrows when I press appropriate tab in properties window during bar replay. And at the end of bar replay,when I run backtest in AA window of AB,it displays PnL and other statistics. While checking these results,I found that last trade of 20th Dec. was marked as loss making trade while it was actually a profitable trade. When I took close look at chart and back testing results,I found a mismatch on this bar.However all other trades have been correctly displayed in BT. My last trade was just before market close (square off of long trade).This trade was correctly marked on chart on last bar of the day.but BT results shows that trade was squared up at 4538 (on 3.15 P.M. bar). I am not able to find reason for mis-match.Pl. guide. http://img15.imageshack.us/img15/884...tradingmis.png http://imageshack.us/photo/my-images/15/discretionarytradingmis.png/ Uploaded with ImageShack.us
  16. Hi If I run my strategy on Sterling Trader pro for auto trading ,will my broker be able to see my strategy/code?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.