[code] ชำแหละ ea simple โหลดไปยำต่อได้
Jun 14, 2016 22:56:52 GMT 7
Post by iamgotzaa on Jun 14, 2016 22:56:52 GMT 7
Code free จาก ea ฟรีทำเงินรายวัน มาชำแหละกันดูว่าทำงานอย่างไร
แจกโค้ดฟรี เพื่อเป็นวิทยาทานแด่ทุกท่าน เพื่อประโยชน์แก่ตัวท่านเอง ได้นำไปทดลองศึกษา ต่อเติมเพื่อประโยชน์ในภายภาคนี้และภายภาคหน้า
รายการไฟล์
ccfpInclude.mqh - เพิ่ม 8:37am 6/15
cstr.mqh
FFCALClass.mqh
LastOrder.mqh
QuantumClass.mqh
SmallFunc.mqh
SympleProzeger.mqh - เพิ่ม 8:37am 6/15
TradingSession.mqh
!!!!กรุณาอย่าถามนะครับว่าลงยังไง!!!!
แจกโค้ดฟรี เพื่อเป็นวิทยาทานแด่ทุกท่าน เพื่อประโยชน์แก่ตัวท่านเอง ได้นำไปทดลองศึกษา ต่อเติมเพื่อประโยชน์ในภายภาคนี้และภายภาคหน้า
รายการไฟล์
ccfpInclude.mqh - เพิ่ม 8:37am 6/15
cstr.mqh
FFCALClass.mqh
LastOrder.mqh
QuantumClass.mqh
SmallFunc.mqh
SympleProzeger.mqh - เพิ่ม 8:37am 6/15
TradingSession.mqh
//+------------------------------------------------------------------+
//| simpleqmech.mq4 |
//| |
//| |
//+------------------------------------------------------------------+
#property copyright ""
#property link ""
#property version "1.00"
#property strict
#include <SmallFunc.mqh>
#include <LastOrder.mqh>
#include <MQL4OBJ.mqh>
#include <FFCALClass.mqh>
#include <SympleProzeger.mqh>
#include <cstr.mqh>
#include <TradingSession.mqh>
FFCALClass ffcal1();
SympleProzeger Machine();
cstr ss();
TradingSession clk(0,6);
input double startlot=0.01;
/*input*/ int targetTP=100;
/*input*/ int LocalBar=300;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- create timer
EventSetTimer(60);
ffcal1.Initialize();
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//--- destroy timer
EventKillTimer();
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
string x="";
Machine.Init_OnTick(Symbol(),-1);
Machine.SetGain(1.44);
//---
if(clk.ok()==false)
{
Comment(".. it end here");
if(!Machine.IsIdle())
{
Machine.SetEntryTP(30);
Machine.Run_OnTick(true,5,targetTP);
}
else
{
Machine.SetEntryLotSize(startlot);
Machine.SetEntryTP((int)(targetTP/2));
Machine.SetRepeatTimeout(15);
Machine.Run_OnTick(true,15,targetTP);
int bars=(int)(LocalBar*1.4);
double intLow3=Low[iLowest(Symbol(),Period(),MODE_LOW,bars,2)];
double intHigh3=High[iHighest(Symbol(),Period(),MODE_HIGH,bars,2)];
if(Machine.AllowRepeat_timeout(OP_BUY) || Machine.IsIdle())
{
if(Low[0]<intLow3 && ss.DecisionPairSell2(Symbol()))
{
Machine.Entry(OP_BUY);
tag(ss.Report_short());
}
}
if(Machine.AllowRepeat_timeout(OP_SELL) || Machine.IsIdle())
{
if(High[0]>intHigh3 && ss.DecisionPairBuy2(Symbol()))
{
Machine.Entry(OP_SELL);
tag(ss.Report_short());
}
}
}
//Machine.CloseAll();
return;
}
ffcal1.RunOnTick();
//StringAdd(x,"\nNewsAllow="+BooleanToString(ffcal1.IsNewsFilterAllow()));
ffcal1.GetText(x);
ss.scan();
//---
//---
double intLow3=Low[iLowest(Symbol(),Period(),MODE_LOW,LocalBar,2)];
double intHigh3=High[iHighest(Symbol(),Period(),MODE_HIGH,LocalBar,2)];
Machine.SetEntryLotSize(startlot);
Machine.SetEntryTP(targetTP);
Machine.SetRepeatTimeout(5);
if(Machine.AllowRepeat_timeout(OP_BUY) || Machine.IsIdle())
{
if(Low[0]<intLow3)
{
Machine.Entry(OP_BUY);
}
}
if(Machine.AllowRepeat_timeout(OP_SELL) || Machine.IsIdle())
{
if(High[0]>intHigh3)
{
Machine.Entry(OP_SELL);
}
}
Machine.Run_OnTick(false,5,targetTP);
StringAdd(x,"intHigh3="+DoubleToString(intHigh3));
StringAdd(x,"intLow3="+DoubleToString(intLow3));
Comment(x,ss.Report());
}
//+------------------------------------------------------------------+
//| Timer function |
//+------------------------------------------------------------------+
void OnTimer()
{
//---
}
//+------------------------------------------------------------------+
//| ChartEvent function |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
const long &lparam,
const double &dparam,
const string &sparam)
{
//---
}
//+------------------------------------------------------------------+
!!!!กรุณาอย่าถามนะครับว่าลงยังไง!!!!