2022年4月9日 星期六

圖表文字的顯示以及說明

最近在研究要如何在圖表上面顯示倉位及振動平均值紀錄一下Text的相關用法


指標範例:

Var : Len(5);

Text_delete(Value1);

Value1 = Text_New(D,T,H,"");

If  marketposition <>0 Then Begin

    Text_SetString( Value1,"Entry at:"+NumToStr(entryprice,0) );

End

Else Begin

 Text_SetString( Value1,"empty" );

End;

Text_SetColor(Value1, White) ;

Text_SetStyle(Value1, 1, 1);

Text_Setattribute(Value1,1,true);

Text_SetSize(Value1,16);

Text_SetBorder( Value1 ,True);


Text_Setlocation(Value1,D,T,GetAppInfo(aiLowestDispValue));



Text_Delete(ObjectID)

從圖表中刪除指定 ID 對象。

為了不讓程式新k棒重複顯示,清除ObjectID資料

當使用Text_New會產生一組ObjectID,成功刪除會回傳0,指定對象失效則回傳-2

Text_New (BarDate, BarTime, PriceValue,"Text")

前三個參數指定K棒的位置,第四個參數顯示要的字串

Text_SetColor(ObjectID,TextColor)

    TextColor顏色的表達方式可以為RGB六碼色組或者17種基本色或者傳統色碼

    三種方法為:

        Text_SetColor(Value1,White) //傳統色碼 white,yellow,blue,green,gray,black

        Text_SetColor(Value1,16777215) //0~16777215

        [LegacyColorValue=True]; 

    Text_ SetColor(Value1,4);//0-16

Text_SetStyle (ObjectID, HorizPl, VertPl)

    HorizPl水平對齊方式:

        0:文字左側對齊K線

        1:文字右側對齊K線

        2:文字中央對齊K線

    VertPl垂直對齊方式:

        0:文字上緣對齊價格

        1:文字下緣對齊價格

        2:文字中央對齊價格

    Text_SetStyle(Value1,1,1);

Text_SetBorder(ObjectID,LogicalExpression)

    LogicalExpression:

        True=增加邊框,False=移除邊框。

        Text_SetBorder( Value1 ,True);

Text_SetAttribute(ObjectID, Attribute, LogicalExpression)

    Attribute 5種值

        0:加框, 1:加粗, 2:斜體, 3:刪除線, 4:下劃線

    LogicalExpression  (True = on and False = off)

    Text_Setattribute(Value1,1,true);

Text_SetLocation(ObjectID,BarDate,BarTime,PriceValue)

    BarDate - K 線日期;日期格式為YYYMMdd

    BarTime - K 線時間;時間格式為24小時制HHmm,1300 = 1:00 PM

    PriceValue -顯示文字的垂直位置

    Text_SetLocation(Value1, Date, Time, High);

GetAppInfo(Attribute)   

aiHighestDispValue — 顯示於價格最上方

aiLowestDispValue — 顯示於價格最下方


以上參考來源:https://www.multicharts.com/trading-software/index.php/Text

2022年4月8日 星期五

第一章 從零開始

為了紀錄一些學習power language的一些筆記
開Blog逼自己要有進度的一個里程碑😆

圖表文字的顯示以及說明

最近在研究要如何在圖表上面顯示倉位及振動平均值紀錄一下Text的相關用法 指標範例: Var : Len(5); Text_delete(Value1); Value1 = Text_New(D,T,H,""); If  marketpositio...