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

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



PureBytes Links

Trading Reference Links

Hi Steve.  I don't think that's the problem... I can easily indicate an 
initial short or long position.  The problem is that the buy signals are 
dependent on prior buys...  I think, as Terry has suggested, that I may need 
to code a loop.  However, I hate to have to do that!

chuck

----- Original Message ----- 
From: "Steve Dugas" <sjdugas@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, December 29, 2005 12:11 PM
Subject: Re: [amibroker] Coding Guidance -- Catch 22!


> Hi,
>
> It sounds like a decision you need to make rather than a coding problem - 
> in
> real life, you would need to use some other criteria to enter your first
> position, since you have no previous buys/shorts. What condition would you
> use to enter your first trade? Then you could use this condition to
> initialize AB's Buy or Short array for future trades.
>
> Steve
>
> ----- Original Message ----- 
> From: "cstrader" <cstrader232@xxxxxxxxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Thursday, December 29, 2005 9:16 AM
> 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
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
> 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/