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

RE: [amibroker] Coding Guidance -- Catch 22!



PureBytes Links

Trading Reference Links

Use loop code and pre-figure all the trades. Then execute your results
with Buy-Sell-Short-Cover. By using looping code you can check
conditions day by day.
--
Terry

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of cstrader
Sent: Thursday, December 29, 2005 07:17
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Coding Guidance -- Catch 22!

I'm stuck on what must be a simple problem.   You can see from the code 
below what I want to do (short if we get more than 6% lower than the
highest 
since the last buy; buy if we get more than 6% higher than the lowest
since 
the last short).  But the catch 22 is that

1.  you cannot know LOWESTPRICE until you short
2.  you cannot short until you know highestprice
3.  you cannot know highestprice until you buy
4.  you cannot buy until you know LOWESTPRICE.

In sum, you can't enter until you get the entry prices, but you can't
get 
the entry prices until you enter!!

Thanks in advance.

Short = C < Highestprice*.94;
LowestPrice = Lowestsince(Short, C);
HighestPrice = HighestSince(Buy, C);
Buy = C > Lowestprice * 1.06;






Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/