COCO研究院

 找回密碼
 註冊
搜索
查看: 4351|回復: 3

[教學] 買跟賣之訊號,輸出成文字檔之程式碼如何撰寫??

[複製鏈接]
發表於 13-1-14 15:32 | 顯示全部樓層 |閱讀模式
如題,因為本身是用外匯forex的mt4下單,但是我的策略與程式分析是用mc,所以想用mc的訊號輸出給mt4下單,目前網路上有提供mt4讀取文字檔程式,但是沒撰寫過mc輸出成文字檔的經驗,不知如何下手,能否哪位高手指導一下(剛學程式不到一個月的新手留)!
發表於 13-1-14 15:54 | 顯示全部樓層
可用 Print(File("filename"),.......); 來達成.. PLE中的HELP.. 請參考..

Print
Sends one or more specified expressions to the PowerLanguage Editor Output Log or another output target, if specified. Any combination of string, true/false, numerical series, or numerical expressions can be specified.


UsagePrint([OutputTarget],Expression1,Expression2,etc.)
Parameter inside the square brackets is optional Parameters OutputTarget- an optional parameter; specifies an output target other then the PowerLanguage Editor Output Log; the parameter must be followed by a comma.

There are two optional output targets:

Printer Specifies the default printer as the output target.

File("PathFilename")
Where: PathFilename - a string expression specifying the path and filename
Specifies an ASCII file as the output target; if the specified file does not exist, the file will be created.

If OutputTarget  is not specified, the output will be sent to the PowerLanguage Editor Output Log.
Expression - a string, true/false, numerical series, or numerical expression; any number of valid expressions, separated by commas, can be used

A string expression  must be enclosed in quotation marks: "String Expression"

A numerical expression  can be formatted to specify the minimum number of characters, including the decimal point, and the number of decimal places, to be used for the output:
Expression:C:D
Where: C - minimum number of characters
             D - number of decimal places


The default output format for a numerical expression is two decimal places and a minimum of seven characters. If the number of decimal places in the numerical expression is more than the specified number, the value will be will be rounded off to the specified number of decimal places.
If the number of characters in the output is less than the specified minimum, leading spaces will be added to bring the output to the specified minimum value.




ExamplePrint(.1);  will print  0.10 in the PowerLanguage Editor Output Log, with three leading spaces inserted
Print(1.555555:6:3);  will print 1.556 in the PowerLanguage Editor Output Log, with one leading space inserted
Print(Printer,"Print Test");  will send the string expression "Print Test" to the default printer
Print(File("C:\test.txt"),CurrentDate,CurrentTime);  will save the output of CurrentDate and CurrentTime to the test.txt file in the root directory of the C: hard drive



評分

參與人數 2金錢 +3 收起 理由
bobo177 + 1 按一個讚!
timberlandwu + 2 按一個讚!

查看全部評分

發表於 13-1-14 16:24 | 顯示全部樓層
參考這篇  http://tw.myblog.yahoo.com/soro.chang/article?mid=29

還有 阿政 網誌也有相關內容 (http://www.yctseng.net/)

評分

參與人數 2金錢 +3 收起 理由
bobo177 + 1 按一個讚!
timberlandwu + 2 按一個讚!

查看全部評分

發表於 13-1-14 18:46 | 顯示全部樓層
小的受教了...
感恩!
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-4-27 02:38

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook