[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Real-Time Heat-Map (was:Displaying HOT-> COLD RGB colors)



PureBytes Links

Trading Reference Links

BlankHerman,

for market volatiity, I use Bollinger bands. Easy to determine volatility by looking at delta between top and botom withrespect to last price.... or any other statistical means ... but how would one relate market pressure to predict breakout ???

Ara
  ----- Original Message ----- 
  From: Herman 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Sunday, January 07, 2007 10:30 AM
  Subject: RE: [amibroker] Real-Time Heat-Map (was:Displaying HOT-> COLD RGB colors)


  Ara, last year I tried to get High-Frequency trading to work but after spending quite a bit of time on it, I found that the data delays/flaws and the divergence of Backtesting result wrt Real-Trading results were insurmountable. Automated trade-executions were not the problem, that worked fine. It was a disappointment... anyway, I decided to set the limit for development at the 1-Minute timeframe; this is approximately where developmental results (for me) diverge from reality.  I still will be using AT but not in the 5-sec TimeFrame.

  Right now i am exploring different options, not sure where I'll be heading. I tried to make a map that would display short-termtrends (like a continuous real-time scan). Such a map would give me a visual presentation of overall market activity. Backtesting doesn't give me a feel for how often and for which stocks tradable events happen in Real Time. A map can show short term conditions/signal/trade activity for 100 stocks at a glance! Like stars sparkling in the sky :-) It gives me a much better appreciation for market activity. The maps are also usefull for other purposes, like to display order/system status and/or portfolio/account status. I prefer everything in one window. 

  On the other list Yuki suggested looking at narrowing volatility and I though that was a good idea. It would be neat to have maps that change color as market pressure for a breakout builds up... but I haven't had a chance to look at this yet. To many ideas but not enough time...

  best regards,
  herman




    -----Original Message-----
    From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]On Behalf Of Ara Kaloustian
    Sent: January 7, 2007 11:41 AM
    To: amibroker@xxxxxxxxxxxxxxx
    Subject: Re: [amibroker] Real-Time Heat-Map (was:Displaying HOT-> COLD RGB colors)


    Herman,

    Heat map makes visual very easy .... 

    Are you getting away from full auto trade?  Is the heat map approach preferred to auto trade?

    Ara
      ----- Original Message ----- 
      From: Herman 
      To: AmiBroker YahooGroups 
      Sent: Sunday, January 07, 2007 5:23 AM
      Subject: [amibroker] Real-Time Heat-Map (was:Displaying HOT-> COLD RGB colors)


      Actually this is just my first try and the code is still evolving. We used to do this type of tabling with AA Explorations however for Real-Time applications I prefer the display on the chart. I would like to use it for portfolio trading to show me where the action is (in Real-Time) wrt my criteria. To reduce processing overhead I would map only tickers that meet my criteria. 

      I thought perhaps some others might see new applications for this type of display, write a standard function to display different types of maps that can be selected from the param window. 

      I still have some trouble automatically scaling the Hue, this requires normalizing and scaling the range, also I would like to have a sort function so that hot-cold are located at diagonally opposite corners. 

      best regards,

      herman

      --- In amibroker@xxxxxxxxxxxxxxx, "cstrader" <cstrader232@xxx> wrote:
      >
      > Herman:  You and Amibroker make a great combination!  Very cool (and hot, I suppose) work.
      > 
      > Do you use the heat map as an index of the market internals for trading indices, or do you use it for trading individual stocks?
      > 
      > chuck
      > 
      > 
      >   ----- Original Message ----- 
      >   From: Herman 
      >   To: AmiBroker YahooGroups 
      >   Sent: Saturday, January 06, 2007 10:50 AM
      >   Subject: [amibroker] Real-Time Heat-Map (was:Displaying HOT-> COLD RGB colors)
      > 
      > 
      >   Thanks for the help, TJ and others!
      > 
      >   I needed a Heat-Map that refreshes during real-time trading. Below is what I have thus far. It uses dummy data: you must define VarToMap. To save time I set it to refresh each 5 seconds. 
      >   The Ticker order is important for me, hence I plotted both upper and lower sections.
      > 
      >   Any tips on how to make this work under Quick-AFL or make it faster in other ways would be appreciated.
      > 
      >   best regards,
      >   herman
      > 
      > 
      > 
      >   // Heat-Map by Herman - 06DEC2007 - TEST/DEMO ONLY!
      > 
      >   // Set Param -> Axis & Grid: NO Middle Lines
      > 
      >   // Convert Variable-To-Map to 0-99 range
      > 
      >   // Zoom Chart to get nice display
      > 
      >    
      > 
      >   SetBarsRequired(1000000,1000000);
      > 
      >   GraphXSpace = 0;
      > 
      >   GraphZOrder = False;
      > 
      >   SetChartOptions( 3, chartShowDates);
      > 
      >   RequestTimedRefresh( MApRefreshInterval = 5 );
      > 
      >   RefreshMap     = Status("redrawaction");
      > 
      >   WLNum          = Param("WatchList Number",0,0,64,1);
      > 
      >   TickersToMap   = Param("Num. Tickers to Map",10,1,64,1);
      > 
      >   MaxTickers     = Param("Max. Tickers",50,2,100,1);
      > 
      >   MaxHue         = Param("Max. Hue",255,0,255,1);
      > 
      >   MinHue         = Param("Min. Hue",97,0,255,1);
      > 
      >    
      > 
      >   if( RefreshMap )
      > 
      >      { 
      > 
      >      TickersToMap   = Min(TickersToMap, MaxTickers);
      > 
      >      List           = CategoryGetSymbols( categoryWatchlist, WLNum );
      > 
      >      MaxList = "";
      > 
      >      for( T=0; (Ticker=StrExtract( List, T))!= "" AND T < TickersToMap; T++)
      > 
      >         {
      > 
      >         MaxList = MaxList + Ticker +",";
      > 
      >         StaticVarSetText("Ticker"+T, Ticker);
      > 
      >         }
      > 
      >      StaticVarSetText("MaxList",MaxList);
      > 
      >      BI                = BarIndex();
      > 
      >      MaxYCoordinate    = TickersToMap;
      > 
      >      MinYCoordinate    = 1;
      > 
      >      MinXBarindex      = BarCount-TickersToMap;
      > 
      >      MaxXBarindex      = BarCount-1;
      > 
      >      CellCount = 0;
      > 
      >      XCoordinate = YCoordinate = 0;
      > 
      >      MaxList = StaticVarGetText("MaxList");
      > 
      >      for( Y=MinYCoordinate; Y <= TickersToMap; Y++ )
      > 
      >         {
      > 
      >         for( X=MinXBarindex; X <= MaxXBarindex; X++ )
      > 
      >            {
      > 
      >            XTicker = StaticVarGetText("Ticker"+XCoordinate); 
      > 
      >            YTicker = StaticVarGetText("Ticker"+YCoordinate);
      > 
      >            VarToMap = CellCount; // must be in range 0-99
      > 
      >            StaticVarSet(XTicker+"-"+YTicker, VarToMap);
      > 
      >            XCoordinate++;
      > 
      >            CellCount++;
      > 
      >            }
      > 
      >         XCoordinate=0;
      > 
      >         YCoordinate++;
      > 
      >         }
      > 
      >      }
      > 
      >    
      > 
      >   Plot(-1,"",1,styleNoLine|styleNoLabel);
      > 
      >   Plot(TickersToMap,"",1,styleNoLine|styleNoLabel);
      > 
      >   BI                = BarIndex();
      > 
      >   MaxYCoordinate    = TickersToMap;
      > 
      >   MinYCoordinate    = 1;
      > 
      >   MinXBarindex      = BarCount-TickersToMap;
      > 
      >   MaxXBarindex      = BarCount-1;
      > 
      >   YStep             = int(MaxYCoordinate/TickersToMap);
      > 
      >   XCoordinate = YCoordinate = 0;
      > 
      >   for( Y=MinYCoordinate; Y<=MaxYCoordinate; Y++ )
      > 
      >      {
      > 
      >      for( X = MinXBarindex; X <= MaxXBarindex; X++ )
      > 
      >         {
      > 
      >         XTicker   = StaticVarGetText("Ticker"+XCoordinate); 
      > 
      >         YTicker   = StaticVarGetText("Ticker"+YCoordinate);
      > 
      >         VarToMap  = StaticVarGet(XTicker+"-"+YTicker); 
      > 
      >         HueStep   = (MaxHue - MinHue)/100;
      > 
      >         Co = ColorHSB(Min(255,int((100-VarToMap)*HueStep)),255,255);
      > 
      >         PlotText(NumToStr(VarToMap,1.0),X,Y-0.5,1);
      > 
      >         if( XTicker == YTicker ) Co = colorBlack;
      > 
      >         Plot(IIf(X==BI,Y,Null),"",Co,styleArea|styleOwnScale|styleNoLabel,-1,MaxYCoordinate*1.03);
      > 
      >         XCoordinate++;
      > 
      >         }
      > 
      >      XCoordinate = 0;
      > 
      >      YCoordinate++;
      > 
      >      } 
      > 
      >    
      > 
      >   for(T=0; T<=TickersToMap; T++) 
      > 
      >      {
      > 
      >      Ticker = StaticVarGetText("Ticker"+T);
      > 
      >      PlotText(Ticker,BarCount,T+0.5,1);
      > 
      >      PlotText("\n"+Ticker,BarCount-TickersToMap+T,-0.5,1);
      > 
      >      }
      > 
      >    
      > 
      >   MaxList = StaticVarGetText("MaxList");
      > 
      >   Title = "Heat Map for Watchlist #"+NumToStr(WLNum,1.0,False)+": "+MaxList;
      >


   


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/618 - Release Date: 1/6/2007 7:47 PM