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

[amibroker] RE:Exit first profitable Trade



PureBytes Links

Trading Reference Links

Hello guys,

I am trying to get code to find the first profitable open after an entry.
This is what I have so far, can someone check it to see if it works?

EntryPriceLong = BuyPrice;
EntryPriceShort = ShortPrice;
Targetfigure = 0;

for( i = 1; i < BarCount; i++ )
{
     if( Buy[i] = 1 )
        {
      Targetfigure[i] = Close[i];
      EntryPriceLong[i] = Open[i];
      }

	 if( Open[ i ] > Targetfigure[i] && Targetfigure[i] > 0)
     {
       Sell[ i ] = 1;
     }
     else
        Sell[ i ] = 0;

}




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/