lam11111 發表於 16-2-25 14:41

如何在畫面上計算利潤????

Buy=C>EMA(H,3);
Sell=0;

Short=EMA(L,3)>C;
Cover= 0;

如何在如何在畫面上計算利潤????

lam11111 發表於 16-2-25 15:00

C14=Param("left-right",2.1,1.0,5.0,0.1 );
C15=Param("up-down",8,1,30,1 );

Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy);

BuyPrice=Buy;
SellPrice=Short;

Bdc=(
WriteIf (Buy AND Ref(shrt,-1), " BUY@ "+C+"","")+
WriteIf(Buy, "LastTrade Profit="+(SellPrice-C)+"","")
);

Sdc=(
WriteIf (Sell AND Ref(Long,-1), " SEll@ "+C+"","")+
WriteIf(Sell , "LastTrade Profit="+(C-BuyPrice)+"","")
);

Ndc=(
WriteIf(Long AND NOT Buy, "Long@"+WriteVal((BuyPrice))+" /Profit="+WriteVal((C-BuyPrice))+"","")+
WriteIf(Shrt AND NOT Sell, "Short@"+WriteVal((SellPrice))+" /Profit="+WriteVal((SellPrice-C))+"","")
);
GfxSetBkMode( 0 );
GfxSelectFont("Tahoma", 12, 400, False, False, 0);
GfxSetTextColor(colorYellow);
GfxTextOut(""+Ndc+"", Status("pxwidth")/C14, Status("pxheight")/C15*2.0);



這是我找到是範例,可是卻不行,求大大幫幫忙

amibroker 發表於 16-4-19 18:27

use static variable to store open price. sample "-10" sell at 10.
頁: [1]
查看完整版本: 如何在畫面上計算利潤????