Re: [amibroker] Re: Multiple dates storage and future prodate projection

 

Panos- Thanks for sharing the code.  I saved it as a snippet for later use.  Seems like this would be a good function for Tomasz to add to the AFL library. -Alan

On 3/5/2016 6:01 PM, Panos Boufardeas panosbouf@freemail.gr [amibroker] wrote:
 

Hello..  as for your first Question use the below code

>> I am trying to do the following:

>> 1- store multiple  dates on a click of a mouse in daily or intraday.



SetChartOptions(0,chartShowArrows|chartShowDates);

Plot( C, "Price", IIf( C < O,colorGrey50, colorGrey50), styleCandle ) ;
SetBarsRequired ( sbrAll, sbrAll );

///////////Find the Start and End barindex  by pressed by  CLR or Shift + Left mouse Click////////////
B  = GetCursorMouseButtons();
Control_Pressed = GetAsyncKeyState( 17 ) < 0; // CONTROL key pressed,
Shift_Pressed = GetAsyncKeyState( 16 ) < 0; // Shift key pressed,
bi=BarIndex();  Lbi =LastValue(bi);

if ( B & 1 AND CONTROL_Pressed )
   {
    StartBi= LastValue( SelectedValue(BI) );
     StaticVarSet( "StartBi"+getchartid(), StartBi) ;
     StaticVarSet( "StartbarBi"+getchartid(), SelectedValue(BI)) ;
    }
if ( B & 1 AND Shift_Pressed )
   {
    endBi = LastValue( SelectedValue(BI) );
     StaticVarSet( "endBi"+getchartid(), endBi);
    }
if ( B & 4) { StaticVarRemove("*Bi"+ getchartid()); }   
//////////////////////////////////////////////////////////

start=StaticVarGet( "StartBi"+getchartid());   "startBi " + WriteVal(start);
stop= StaticVarGet("endBi"+getchartid());        "stopBi " + WriteVal(stop);
Plot( IIf(bi==start,1,0), "StartBI", colorgreen, styleHistogram |styleDashed|styleOwnScale |styleNoLabel); // start bar styleHistogram
Plot( IIf(bi==stop,1,0), "stopBI", colorred, styleHistogram|styleDashed|styleNoLabel |styleOwnScale ); // End bar styleHistogram

Panos


On 05-03-16 3:55 PM, portfoliobuilder99@gmail.com [amibroker] wrote:
 
For a couple of your questions these may help.

You want to draw an arc? See attached screen shot or maybe what you are looking for is here:
OR

http://www.amibroker.com/guide/afl/gfxarc.html


You want to count bars between conditions? perhaps these posts will help get you started

http://amibrokerforum.proboards.com/thread/101/bars-different-value-condition

 

http://amibrokerforum.proboards.com/thread/75/start-period-recognition


But I agree with Alan. Try finding a solution, post your code and then ask why it is not working. When asking questions on the forum be specific, give an example or a detailed explanation.


Try  a  "Search" on this forum as many topics have been discussed.

Try eMail AmiBroker technical support if there is no help on this forum.

There are many code writers for hire. Google search AmiBroker code writing and hire someone to help you.





__._,_.___

Posted by: Alan <alan@thenorthams.us>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

Check out the automatic photo album with 1 photo(s) from this topic.
Arc.PNG

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv