Stop, Entry & Target Drawing Tool

Discussion in 'AmiBroker' started by dgcruzing, Jun 15, 2009.

  1. Here is a link to the video on youtube of it in action..it is of Australian Iron ore stocks in play at the moment
    Code:
    http://www.youtube.com/watch?v=zx-lEI9970s

    [​IMG]

    first draw three horizontal lines
    in the studyid put
    TG,EN or SL in each one, defining entry,target and stop loss

    Also for those that try this afl you need to "right click" your study lines
    then "properties" to put in the TG, EN, SL codes..

    Code:
    
    Plot(C, "Price", colorBlack, styleCandle,Null,Null,0); 
    _SECTION_BEGIN("risk profile");
    
    SetBarsRequired(1000000,1000000);
    BlankBarsInRightMargin = 25;
    LastVisiblebar = Status("firstvisiblebarindex");
    FirstVisibleBar= Status("lastvisiblebarindex")-BlankBarsInRightMargin;
    
    Entry_Study = Study("EN", GetChartID() );
    Entry = LastValue( ValueWhen( ExRem( Entry_Study, 0 ), Entry_Study ) );
    
    Target_Study = Study("TG", GetChartID() );
    Target = LastValue( ValueWhen( ExRem( Target_Study, 0 ), Target_Study ) );
    
    StopLoss_Study = Study("SL", GetChartID() );
    StopLoss = LastValue( ValueWhen( ExRem( StopLoss_Study, 0 ), StopLoss_Study ) );
    
    Reward=Target-Entry;
    Risk=Entry-StopLoss;
    RRR=Reward/Risk;
    p_reward=reward*100/Entry;
    p_Risk=Risk*100/Entry;
    
    PlotText("StopLoss: "+StopLoss,FirstVisibleBar-2,StopLoss,colorBlack);
    PlotText("Entry: "+Entry,FirstVisibleBar-2,Entry,colorBlack);
    PlotText("Entry",LastVisiblebar+2,Entry,colorBlack);
    PlotText("Target: "+Target,FirstVisibleBar-2,Target,colorBlack);
    PlotText("Target",LastVisiblebar+2,Target,colorBlack);
    PlotText("Stoploss",LastVisiblebar+2,StopLoss,colorBlack);
    PlotText("Risk: "+Prec(abs(Risk), 2 )+" (%"+Prec(abs(P_Risk), 2 )+")",FirstVisibleBar-2,StopLoss+Risk/2,colorRed);
    PlotText("Reward: "+Prec(abs(Reward), 2 )+" (%"+Prec(abs(p_reward), 2 )+")",FirstVisibleBar-2,Entry+Reward/2,colorGreen);
    PlotText("RRR: "+Prec(abs(RRR), 2 ),FirstVisibleBar-30,StopLoss,colorBlack);
    
    PlotOHLC( Entry,  Entry,  Target, Target, "", ColorRGB(220,250,220),styleCloud|styleNoRescale,Null,Null,20 );
    PlotOHLC( Entry,  Entry,  StopLoss, StopLoss, "", ColorRGB(250,220,220),styleCloud|styleNoRescale,Null,Null,20 );
    
    _SECTION_END();
    
    Thanks to Kaka on another board for doing this one for me..

    the tool as is is great for the EOD analyst of a trade.. but also for the slow periods during the day..

    I would say this is where the Profitsource tool (within their software as per Youtube video posted) is good.. as it is a point and click tool..
    with luck in future versions of AB might include such a tool in the Drawing tools.. much like a fib line extension .. but what we got at the moment is s step in the right direction..

    Now that we got this far.. is there away to put it in to a .dll so that we could drop and drag it like the video style..

    I know I am asking for a bit much.. but if someone works this will for sure be a great tool for Amibroker

    actually.. I would be prepared to donate.. as it is for sure a tool a lots of traders would use in their daily studies and decision making process.. also a drop and drag would save time when you are in the hot seat of making a trade.. as we all know what it is like when we are watching the market and are ready to make a move/daytrade (1 hour trade!!!)..

    Tensions run high as we have our minds in the zone on the trade..
     
  2. thanks for sharing it with everyone here!
     
  3. Not a problem..
    hope to share more as I get them..
    I have a good collection now of AFL's and as I am based in Tianjin it is only fair that I share them..

    what I need is a good working version of 5.2.. as I keep hitting a brick wall with the copy I have got.. I only get a few days then it kicks me out..
    hint hint.. if anyone knows of a way round it..
     
  4. search this sub-forum, there is a good dll for you. ;)
     
  5. Thanks Expresso,
    I think I found the one and got a copy of it but it is the same as the onoes floating around..

    unfortunalety I find it does not work on my system... I usely only get a day or two then it crashs on me with a register box.. humm and I haven cleaned the registry of all entries that many times..sign!!!!
     
  6. 谢谢
     
  7. 你的5.20显示的注册信息是Shashi Sethi吗?这个版本应该是可用的,如果有问题可能是AmiQuote 2.0的问题?

    备份你的amibroker资料!

    AmiQuote 2.0 安装后会导致AmiBroker不工作,
    原因:
    AmiQuote 2.0 运行后会在Plugins文件夹下生成一个隐含文件 (.dll), 导致下一次AmiBroker启动时不工作。

    解决方案:
    1. 最简单的方案: 启动AmiBroker之前,到Plugins文件夹下删掉AmiQuote 2.0生成的.dll文件。 你有可能要改动Explorer的选项才会显示隐含文件。
    2. 一劳永逸方案, 当然麻烦些: 用你的防火墙阻止AmiQuote 2.0访问amibroker.com (74.200.70.129), 我个人用的是免费的Comodo Firewall Pro, 加上它的Defense+.
    你可以用Defense+禁止AmiQuote 2.0在Plugins文件夹生成文件。
     
  8. WJ, thanks for that and this is what I was taking about in the http://www.hylt.net/vb/showthread.php?t=19075

    but this will not work on my system as all I get is license error please contact Ami..
    at this stage I will say with 5.0 as it is doing the job.. I just kiss out on some of the new programming..
    thank you for your reply
    dg
     
  9. 你试试这个AmiQuote 2。11 key看看?
    LRVFCRVVHWM
     
  10. 谢谢

    似乎为这个下载者2.1工作。
    万一看起来,我将注意.dll