COCO研究院

 找回密碼
 註冊
搜索
查看: 2401|回復: 2

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

[複製鏈接]
發表於 16-2-25 14:41 | 顯示全部樓層 |閱讀模式
Buy=C>EMA(H,3);
Sell=0;

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

如何在如何在畫面上計算利潤????
 樓主| 發表於 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);



這是我找到是範例,可是卻不行,求大大幫幫忙
發表於 16-4-19 18:27 | 顯示全部樓層
use static variable to store open price. sample "-10" sell at 10.
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-11-22 09:14

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 |