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

[amibroker] Re: How do you know what your last trade was



PureBytes Links

Trading Reference Links




Herman, 

Thanks for your suggestion. However as far as I can see this approach 
doesn't do what I want. Let me re-iterate I want to be able to tell 
at any time what was the last trade I opened(Buy or Short). I then 
want to test for  stop condition appropriate to the type of trade I 
am in and exit if necessary.

According to the documentation the effect of flip is to reverse the 
effect of exrem (as per the text below:

<i>EXAMPLE buy = ExRem( buy, sell ); buy = Flip( buy, sell ); // this 
essentially reverts the process of ExRem - multiple signals are back 
again  </i>

It doesn't seem to tell me what my current position is. Also it seems 
to default to Sell. My Onsell value comes up right from the first bar 
even though there has been no signal.

Thanks for your help but unless I have missed something basic this 
doesn't solve the problem.

Cheers


MM



--- In amibroker@xxxxxxxxxxxxxxx, "Herman van den Bergen" 
<psytek@xxxx> wrote:
> In many cases, after your definition of the raw Buy and Sell 
signals you can
> create a position array like so:
> 
> LongPosition = Flip(Buy,Sell);
> ShortPosition = Flip(Short,Cover);
> 
> You can update these arrays each time you change the signals by 
repeating
> these statements, for example after an ApplyStop().
> 
> best regards,
> herman
>   -----Original Message-----
>   From: micmus2002 [mailto:micmus2002@x...]
>   Sent: Monday, October 04, 2004 10:34 PM
>   To: amibroker@xxxxxxxxxxxxxxx
>   Subject: [amibroker] How do you know what your last trade was
> 
> 
> 
>   I want to write stop logic, but since its based on a logical test 
I
>   cannot seem to use the applystop function.
> 
>   Therefore  it seems I will need to have another Cover /Sell 
statement
>   which will only be triggered if I already have an opposite 
position.
>   i.e. Cover if am already Short and my stop condition is true, and
>   Sell if I am already long and that stop position is true.
> 
>   This means I need to know what my current position is, and my
>   question is how do I do this. I know Wealthlab has a Position 
Array
>   but I can't find anything similar in AB.
> 
>   I am sure there must be a way to do this. Would be grateful if
>   someone could provide the code.
> 
>   Thanks
> 
> 
> 
> 
> 
> 
> 
> 
> 
>   Check AmiBroker web page at:
>   http://www.amibroker.com/
> 
>   Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> 
>         Yahoo! Groups Sponsor
> 
>                  Select Your
> 
State:AlabamaAlaskaArkansasArizonaCaliforniaColoradoConnecticutDelawar
eFlori
> 
daGeorgiaHawaiiIdahoIllinoisIndianaIowaKansasKentuckyLouisianaMaineMar
ylandM
> 
assachusettsMichiganMinnesotaMissippiMissouriMontanaNebraskaNevadaNew
> HampshireNew MexicoNew JerseyNew YorkNorth CarolinaNorth
> DakotaOklahomaOhioOregonPennsylvaniaRhode IslandSouth CarolinaSouth
> DakotaTennesseeTexasUtahVermontVirginiaWashingtonWashington D.C.West
> VirginiaWisconsinWyoming
> 
>                  PurchaseRefinance
> 
> 
> 
> 
> 
> 
> --------------------------------------------------------------------
--------
> --
>   Yahoo! Groups Links
> 
>     a.. To visit your group on the web, go to:
>     http://groups.yahoo.com/group/amibroker/
> 
>     b.. To unsubscribe from this group, send an email to:
>     amibroker-unsubscribe@xxxxxxxxxxxxxxx
> 
>     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.
> 
> 
> 
> [Non-text portions of this message have been removed]





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/