PureBytes Links
Trading Reference Links
|
Thank you very much for your help.
Franck you are right my intention was to write PProfit, but it also does not work.
Tomasz with your modification I have some results but not what I'm waiting for.
I'm looking to have in the last column the profit accumulated trade by trade.
so I have modified the code with:
CumProfit = Cum( IIF( IsEmpty( Profit ), 0, Profit ) );
But as you can see in the attached jpg, the calculated values are not correct.
What am I missing ?
Thank you very much for your help.
Bernard Bourée
bernard@xxxx
----- Original Message -----
From: Tomasz Janeczko
To: amibroker@xxxxxxxxxxxxxxx
Sent: Sunday, August 12, 2001 11:05 PM
Subject: Re: [amibroker] Exploration
Hi Bernard,
There are some small mistakes in your formula,
here comes fixed one:
buy = cross (macd(), 0);
sell = cross ( 0, macd());
buy = exrem( buy, sell);
sell = exrem (sell, buy);
position = iif(buy, 1, iif( sell, -1, 0));
buyprice = ValueWhen( buy, C, 1);
sellprice = ValueWhen( sell, C, 1);
profit = buyprice - sellprice;
PProfit = 100 * Profit / BuyPrice;
CumProfit = Cum( IIF( IsEmpty( Profit * sell ), 0, Profit * sell ) );
filter =sell;
numcolumns = 6;
column0 = position;
column0Name ="Pos.";
column1= buyprice;
column1Name = "Buy p.";
column2 = sellprice;
column2Name = "Sell P.";
column3 = profit;
column3Name = "Profit";
column4 = PProfit;
column4Name = "Profit%";
column5 = CumProfit;
column5Name = "CumProf.";
Best regards,
Tomasz Janeczko
------------------------------------------------
AmiBroker - the comprehensive share manager
http://www.amibroker.com
----- Original Message -----
From: Bernard Bourée
To: amibroker@xxxxxxxxxxxxxxx
Sent: Sunday, August 12, 2001 9:18 AM
Subject: [amibroker] Exploration
Hello
I have the following exploration :
buy = cross (macd(), 0);
sell = cross ( 0, macd());
buy = exrem( buy, sell);
sell = exrem (sell, buy);
position = iif(buy, 1, iif( sell, -1, 0));
buyprice = valuewhen( buy, C, 1);
sellprice = ValueWhen( sell, C, 1);
profit = buyprice - sellprice;
PProfit = 100 * Profit / BuyPrice;
CumProfit = Sum( Profit, BarsSince(Profit));
filter =buy or sell;
numcolumns = 6;
column0 = position;
column0Name ="Pos.";
column1= buyprice;
column1Name = "Buy p.";
column2 = sellprice;
column2Name = "Sell P.";
column3 = profit;
column3Name = "Profit";
column4 = PProfit;
column4Name = "Profit%";
column5 = CumProfit;
column5Name = "CumProf.";
Everything is OK except for the CumProfit which give 0.
The idea is to obtain in this column the cumulative profit trade by trade.
Any idea ?
Bernard Bourée
bernard@xxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
------=_NextPart_001_0057_01C124EF.06EC07C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4616.200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Franck and Tomasz,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thank you very much for your help.</FONT></DIV>
<DIV><FONT face=Arial size=2>Franck you are right my intention was to write
PProfit, but it also does not work.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Tomasz with your modification I have some results
but not what I'm waiting for.</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm looking to have in the last column theprofit
accumulated trade by trade.</FONT></DIV>
<DIV><FONT face=Arial size=2>so I have modified the code with:</FONT></DIV>
<DIV><FONT face=Arial size=2>CumProfit = Cum( IIF( IsEmpty( Profit ), 0,
Profit ) );</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>But as you can see in the attached jpg, the
calculated values are not correct.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>What am I missing ?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thank you very much for your help.</DIV>
<DIV><BR></DIV></FONT>
<DIV>Bernard Bourée<BR><A
href="mailto:bernard@xxxx">bernard@xxxx</A></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
Tomasz Janeczko
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=amibroker@xxxxxxxxxx
href="mailto:amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, August 12, 2001 11:05
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [amibroker]
Exploration</DIV>
<DIV><BR></DIV>
<DIV><FONT face="Arial CE" size=2>Hi Bernard,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>There are some small mistakes in your formula,</FONT></DIV>
<DIV><FONT size=2>here comes fixed one:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT face="Arial CE" size=2>buy = cross (macd(), 0);<BR>sell = cross (
0, macd());<BR> <BR>buy = exrem( buy, sell);<BR>sell = exrem (sell,
buy);<BR> <BR>position = iif(buy, 1, iif( sell, -1, 0));<BR>buyprice =
ValueWhen( buy, C, 1);<BR>sellprice = ValueWhen( sell, C, 1);<BR>profit=
buyprice - sellprice;<BR> <BR>PProfit = 100 * Profit /
BuyPrice;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Arial CE" size=2>CumProfit = Cum( IIF( IsEmpty( Profit * sell
), 0, Profit * sell ) );<BR> </FONT></DIV>
<DIV><FONT face="Arial CE" size=2>filter =sell;<BR> <BR>numcolumns =
6;<BR>column0 = position;<BR>column0Name ="Pos.";<BR>column1=
buyprice;<BR>column1Name = "Buy p.";<BR>column2 = sellprice;<BR>column2Name =
"Sell P.";<BR>column3 = profit;<BR>column3Name = "Profit";<BR>column4=
PProfit;<BR>column4Name = "Profit%";<BR>column5 = CumProfit;<BR>column5Name =
"CumProf.";</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT face="Arial CE" size=2><BR>Best regards,<BR>Tomasz
Janeczko<BR>------------------------------------------------<BR>AmiBroker-
the comprehensive share manager<BR><A
href="http://www.amibroker.com">http://www.amibroker.com</A></FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial ce">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial ce; font-color: black"><B>From:</B>
<A title=bernard@xxxx href="mailto:bernard@xxxx">Bernard
Bourée</A> </DIV>
<DIV style="FONT: 10pt arial ce"><B>To:</B> <A
title=amibroker@xxxxxxxxxxxxxxx
href="mailto:amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx</A></DIV>
<DIV style="FONT: 10pt arial ce"><B>Sent:</B> Sunday, August 12, 20019:18
AM</DIV>
<DIV style="FONT: 10pt arial ce"><B>Subject:</B> [amibroker]
Exploration</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>Hello</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have the following exploration :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>buy = cross (macd(), 0);<BR>sell =cross ( 0,
macd());</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>buy = exrem( buy, sell);<BR>sell =exrem (sell,
buy);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>position = iif(buy, 1, iif( sell, -1,
0));<BR>buyprice = valuewhen( buy, C, 1);<BR>sellprice = ValueWhen(sell, C,
1);<BR>profit = buyprice - sellprice;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>PProfit = 100 * Profit / BuyPrice;<BR>CumProfit
= Sum( Profit, BarsSince(Profit));</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><BR>filter =buy or sell;</DIV>
<DIV> </DIV>
<DIV>numcolumns = 6;<BR>column0 = position;<BR>column0Name
="Pos.";<BR>column1= buyprice;<BR>column1Name = "Buy p.";<BR>column2 =
sellprice;<BR>column2Name = "Sell P.";<BR>column3 = profit;<BR>column3Name =
"Profit";<BR>column4 = PProfit;<BR>column4Name = "Profit%";<BR>column5 =
CumProfit;<BR>column5Name = "CumProf.";<BR></DIV>
<DIV>Everything is OK except for the CumProfit which give 0.</DIV>
<DIV>The idea is to obtain in this column the cumulative profit trade by
trade.</DIV>
<DIV> </DIV>
<DIV>Any idea ?</DIV>
<DIV> </DIV></FONT>
<DIV><FONT face=Arial size=2>Bernard Bourée<BR><A
href="mailto:bernard@xxxx">bernard@xxxx</A></FONT></DIV><BR><TT>Your
use of Yahoo! Groups is subject to the <A
href="http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</A>.</TT>
<BR></BLOCKQUOTE><BR><TT>Your use of Yahoo! Groups is subject to the <A
href="http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</A>.</TT>
<BR></BLOCKQUOTE></BODY></HTML>
------=_NextPart_001_0057_01C124EF.06EC07C0--
Attachment:
jpg00024.jpg
Attachment:
Description: "Description: JPEG image"
|