如何用mql4语言 编写外汇趋势交易程序-pg电子官方
如何用mql4语言 编写外汇趋势交易程序
第一步:打开mt4软件,如下图点击编辑窗口
第二步:编写程序,具体程序就看你想怎么设了,前提是得懂程序语言。
一个简单的数据链表的源代码
#include #include typedef int datatype; typedef struct node { datatype data; struct node *next; }linklist; struct node *create_linklist() { struct node *head; head = (struct node *)malloc(sizeof(struct node)); head->next = null; return head;} //澶存娉?int insert_head_linklist(struct node *head,datatype data) { struct node *temp; temp = (struct node *)malloc(sizeof(struct node)); temp->data = data; temp->next = head->next; head->next = temp; return 0;} //灏炬娉?int insert_tail_linklist(struct node *head,datatype data) { struct node *p = head->next; struct node *temp; temp = (struct node *)malloc(sizeof(struct node)); temp->data = data; while(p->next != null) p = p->next; p->next = temp; temp->next = null; return 0;} //镌 int insert_order_linklist(struct node *head,datatype data) { struct node *temp; struct node *p = head; //镓惧跺涓涓镣? while(p->next != null && p->next->data < data) p = p->next; temp = (struct node *)malloc(sizeof(struct node)); temp->data = data; temp->next = p->next; p->next = temp; return 0; } //阈捐〃reverse瀛桦 int reverse_linklist(struct node *head) { struct node *current,*p; p = head->next; current = p->next; p->next = null;//阈炬 while(current) { p = current->next;//淇涓涓镣? //澶存娉? current->next = head->next; head->next = current; //镟存current镌 current = p; } return 0;} //场//涓涓瀹幂 int print_linklist(struct node *head) { struct node *p = head->next; while(p) { printf(%d ,p->data); p = p->next; } printf(n); return 0;} int main() { linklist *l; int i = 0; l = create_linklist(); for(i = 0;i < 10;i ) { insert_head_linklist(l,i); } print_linklist(l); for(i = 15;i < 20;i ) { insert_tail_linklist(l,i); } print_linklist(l); for(i = 10;i < 15;i ) { insert_order_linklist(l,i); } print_linklist(l); reverse_linklist(l); print_linklist(l); return 0; } 这代码在linux下写的,拿出来后,注释成了乱码