커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
7646
글번호 230811
답변완료
질문드립니다.
수고많습니다.
1. yesgrobal 나스닥(NQ_1)에서 전일폭 일정부분 상승이면 매수,하락이면 매도하는
시스템을 만들어 주세요.
var1= dayhigh(1)-daylow(1);
if marketposition==0 AND stime >=84000 then
{
buy("",atstop,dayopen+var1*0.5);
sell("",atstop,dayopen-var1*0.5);
}
1) 왜진입이 8:50분이 되는 경우가 없고, 다들 9시 넘게 되는지 돌려보고
그 이유를 좀 알려주시고요. 해결된 예제를 하나 보여주세요.
2. 전전일 매매가 2번 있었고,이익이 -1p보다 클때...를 수식화.
감사합니다.
2012-07-15
364
글번호 52893
답변완료
백테스트를 하려고 하는데
과거 선물지수는 데이터가 제공되지 않는 거 같아서요. 1분봉으로 백테스트를 하려고 합니다.
2011년 9월물 데이터를 받을 수 있습니까?
만약 받을 수 있다면 어떻게 하면 되나요?
만약 받을 수 없다면 백테스트를 어떻게 하죠?
어떻게 하면 1분봉으로 몇 년 전 기간에 대해서도 백테스트를 할 수 있을까요?
2012-07-15
409
글번호 52892
답변완료
봉차트
갭을 봉차트로 만들고 싶습니다.예를들어 전일 종가가 시가 ,금일 시가가 종가로된 차트
말하자면 갭이 1포 상승한경우 1포 양봉으로 갭이 1포 하락한 경우 1포 음봉으로
일반 봉차트처럼 만들수 있을까요?그리고 가능하면 이 갭봉차트의 5,10,20,60,120 이평선 설정도 함께 부탁 드립니다.
가능하면 이메일로 보내주시면 감사하겠습니다.
이메일 주소:caf222@hanmail.net
수고 많으십니다.감사합니다.
2012-07-15
925
글번호 52891
답변완료
매수청산이후 최저가 문의입니다.
항상 친절하고 빠른 답변에 감사드립니다.
30분봉에서 매수청산이후 계속 저가가 하락할 때
저가를 계속 갱신할경우 최저가를 변수값으로 입력받으려는데 아래 수식이 맞는것인지 검토해 주세요..
Var : LL(0);
LL = Lowest(L,BarsSinceExit(1));
if date != date[1] then
var1 = LL;
if var1 > LL then
var1 = LL;
2012-07-14
401
글번호 52890
답변완료
지표식문의드립니다.
선물 3분봉에서 시초가부터 봉5개(15분)까지의 봉중 최고가,최저가, 중심가(최고가와 최저가의 50%)를 선으로 차트에 나타내고자 합니다.
즉 최고가선, 최저가선, 중심가선이 차트에 표시되도록 하고자 합니다.
부탁드립니다.
2012-07-14
386
글번호 52889
답변완료
^^THV 재문의... 소스를 가져왔는데... mq4...
예스탁에서 쓸수 있을까요?
가능하면 압축화일안의것들 다 변환해주시면 감사하겠습니다
s elct라는 단어가 들어가면 게시판작성이 안된다고하여서 한칸씩 다 띠어서 올렸습니다
THV_EA.mq4
// trailingpositions 가 문제된다고함
//+------------------------------------------------------------------+
//| THV EA.mq4 |
//| Copyright ? 2009, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#define MAGICMA 20050610
extern double Lots = 1;
extern double MaximumRisk = 0.3;
extern double DecreaseFactor = 1;
extern bool PrefSettings = true;
extern bool MM = true;
extern bool AccountIsMicro = false;
extern int TakeProfit = 42;
extern int StopLoss = 84;
extern int TrailingStop = 50;
extern double lTrailingStop = 50;
extern double sTrailingStop = 50;
extern bool UseSignal1 = true;
extern bool UseSignal2 = true;
extern bool UseSignal3 = true;
extern bool UseSignal4 = true;
extern bool UseSignal5 = true;
extern bool UseSignal6 = true;
extern int TradeFrom1 = 0;
extern int TradeUntil1 = 24;
extern int TradeFrom2 = 0;
extern int TradeUntil2 = 0;
extern int TradeFrom3 = 0;
extern int TradeUntil3 = 0;
extern int TradeFrom4 = 0;
extern int TradeUntil4 = 0;
color color1 = Red;
color color2 = White;
color color3 = Red;
color color4 = White;
bool Alert_On = false;
bool Arrows_On = false;
bool Email_Alert = false;
// 'THV3 Trix v4.01 Div'
extern string note1 = "Trix level colors";
extern color HighLine_Color = FireBrick;
extern color ZeroLine_Color = DimGray;
extern color LowLine_Color = DarkGreen;
extern int Line_style = 2;
extern string note2 = "Cobra Label colors";
extern color text1Color;
extern color text2Color;
extern color text3Color = Green;
extern bool MsgAlerts = false;
extern bool SoundAlerts = true;
extern bool eMailAlerts = false;
extern bool AlertOnTrixCross = true;
extern bool AlertOnTrixSigCross = true;
extern bool AlertOnSlopeChange = true;
extern string TrixCrossSound = "trixcross.wav";
extern int AnalyzeLabelWindow = 1;
extern bool AnalyzeLabelonoff = true;
extern int Trixnum_bars = 750;
extern string seperator2 = "*** Convergence/Divergence Settings ***";
extern int NumberOfDivergenceBars = 500;
extern bool drawPriceTrendLines = true;
extern bool drawIndicatorTrendLines = false;
extern bool ShowIn1MChart = false;
extern string _ = "--- Divergence Alert Settings ---";
extern bool EnableAlerts = true;
extern string _Info1 = "";
extern string _Info2 = "------------------------------------";
extern string _Info3 = "SoundAlertOnDivergence only works";
extern string _Info4 = "when EnableAlerts is true.";
extern string _Info5 = "";
extern string _Info6 = "If SoundAlertOnDivergence is true,";
extern string _Info7 = "then sound alert will be generated,";
extern string _Info8 = "otherwise a pop-up alert will be";
extern string _Info9 = "generated.";
extern string _Info10 = "------------------------------------";
extern string _Info11 = "";
extern bool SoundAlertOnDivergence = true;
extern bool EmailDivergenceAlerts = false;
extern string __ = "--- Divergence Color Settings ---";
extern color BullishDivergenceColor = DodgerBlue;
extern color BearishDivergenceColor = FireBrick;
extern string ___ = "--- Divergence Sound Files ---";
extern string ClassicBullDivSound = "CBullishDiv.wav";
extern string ReverseBullDivSound = "RBullishDiv.wav";
extern string ClassicBearDivSound = "CBearishDiv.wav";
extern string ReverseBearDivSound = "RBearishDiv.wav";
int res;
int lasttrend = 0;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
Comment("THV Forex Trading Strategy By CobraForex - Coded by OllyTrader");
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
Comment("");
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
//---- check for history and trading
if(Bars<100 || IsTradeAllowed()==false) return;
//---- calculate open orders by current symbol
if(CalculateCurrentOrders(Symbol())==0) CheckForOpen();
else
{
CheckForClose();
//TrailingPositions();
TrailingPositionsBuy(lTrailingStop);
TrailingPositionsSell(sTrailingStop);
}
//CheckForClose();
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Calculate open positions |
//+------------------------------------------------------------------+
int CalculateCurrentOrders(string symbol)
{
int buys=0,sells=0;
//----
for(int i=0;i<OrdersTotal();i++)
{
if(OrderS elect(i,S ELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGICMA)
{
if(OrderType()==OP_BUY) buys++;
if(OrderType()==OP_SELL) sells++;
}
}
//---- return orders volume
if(buys>0) return(buys);
else return(-sells);
}
//+------------------------------------------------------------------+
//| Calculate optimal lot size |
//+------------------------------------------------------------------+
double LotsOptimized()
{
double lot=Lots;
int orders=HistoryTotal();
int losses=0;
lot=NormalizeDouble(AccountFreeMargin()*MaximumRisk/1000.0,1);
if(DecreaseFactor>0)
{
for(int i=orders-1;i>=0;i--)
{
if(OrderS elect(i,S ELECT_BY_POS,MODE_HISTORY)==false) { Print("Error in history!"); break; }
if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue;
//----
if(OrderProfit()>0) break;
if(OrderProfit()<0) losses++;
}
if(losses>1) lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);
}
if(lot<0.1) lot=0.1;
if(MM==false) lot=Lots;
if(AccountIsMicro==true) lot=lot/10;
//--- for CONTEST only
// if(lot > 5) lot=5;
return(lot);
}
//+------------------------------------------------------------------+
//| Check for open order conditions |
//+------------------------------------------------------------------+
void CheckForOpen()
{
bool BuySignal1 = false, SellSignal1 = false;
bool BuySignal2 = false, SellSignal2 = false;
bool BuySignal3 = false, SellSignal3 = false;
bool BuySignal4 = false, SellSignal4 = false;
bool BuySignal5 = false, SellSignal5 = false;
bool BuySignal6 = false, SellSignal6 = false;
double coral = iCustom(NULL, 0, "THV3 Coral_THICK",Alert_On,Arrows_On,Email_Alert,0,0);
double haOpen = iCustom(NULL, 0, "Heiken Ashi",color1,color2,color3,color4,2,0);
double haClose = iCustom(NULL, 0, "Heiken Ashi",color1,color2,color3,color4,3,0);
//double haLow = iCustom(NULL, 0, "Heiken Ashi",color1,color2,color3,color4,0,0);
//double haHigh = iCustom(NULL, 0, "Heiken Ashi",color1,color2,color3,color4,1,0);
double haOpen1 = iCustom(NULL, 0, "Heiken Ashi",color1,color2,color3,color4,2,1);
double haClose1 = iCustom(NULL, 0, "Heiken Ashi",color1,color2,color3,color4,3,1);
double ssa = iIchimoku(NULL, 0, 2, 3, 5, MODE_SENKOUSPANA, 0);
double ssb = iIchimoku(NULL, 0, 2, 3, 5, MODE_SENKOUSPANB, 0);
int fasttrix = 0;
int slowtrix = 0;
double thvtrendDn = iCustom(NULL, 0, "THV3 trend",0,1);
double thvtrendUp = iCustom(NULL, 0, "THV3 trend",1,1);
double thvtrendFlat = iCustom(NULL, 0, "THV3 trend",2,1);
fasttrix = trix("fast");
slowtrix = trix("slow");
if(UseSignal1)
{
if((haOpen < coral))
{
SellSignal1 = true;
}
if(haOpen > coral)
{
BuySignal1 = true;
}
}
if(UseSignal2)
{
if(haOpen < ssb)
{
SellSignal2 = true;
}
if(haOpen > ssa)
{
BuySignal2 = true;
}
}
if(UseSignal3)
{
if(fasttrix == 2 && slowtrix == 4)
{
SellSignal3 = true;
}
if(fasttrix == 1 && slowtrix == 3)
{
BuySignal3 = true;
}
}
if(UseSignal4)
{
int iHour=TimeHour(LocalTime());
int ValidTradeTime = F_ValidTradeTime(iHour);
if(ValidTradeTime==true)
{
BuySignal4=true;
SellSignal4=true;
}
}
if(UseSignal5)
{
if(thvtrendDn > 0)
{
SellSignal5 = true;
}
if(thvtrendUp > 0)
{
BuySignal5 = true;
}
}
if(UseSignal6)
{
if(haOpen > haClose)
{
SellSignal6 = true;
}
if(haOpen < haClose)
{
BuySignal6 = true;
}
}
//=================END SIGNALS=====
//=================SELL CONDITIONS=====
// if((SellSignal1==true) && (SellSignal2==true) && (SellSignal3==true))
if((SellSignal1==true) && (SellSignal2==true) && (SellSignal3==true) && (SellSignal4==true) && (SellSignal5==true) && (SellSignal6==true))
{
if(AccountFreeMargin()<(1000*LotsOptimized()))
{
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
Print("thvtrendDn:",DoubleToStr(thvtrendDn,4),";thvtrendUp:",DoubleToStr(thvtrendUp,4),";thvtrendFlat:",DoubleToStr(thvtrendFlat,4),";Sell|Coral: ",DoubleToStr(coral,4),";haOpen: ",haOpen,";ssa:",ssa,";ssb",ssb);
if((lasttrend == 1) || (lasttrend == 0)) //res=OrderSend(Symbol(),OP_SELL,LotsOptimized(),Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"THV ea",MAGICMA,0,Red);
Alert("Sell Signal on ",Symbol()," -> ",Period());
lasttrend = -1;
return;
}
//=================BUY CONDITIONS====
// if((BuySignal1==true) && (BuySignal2==true) && (BuySignal3==true))
if((BuySignal1==true) && (BuySignal2==true) && (BuySignal3==true) && (BuySignal4==true) && (BuySignal5==true) && (BuySignal6==true))
{
if(AccountFreeMargin()<(1000*LotsOptimized()))
{
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
Print("thvtrendDn:",DoubleToStr(thvtrendDn,4),";thvtrendUp:",DoubleToStr(thvtrendUp,4),";thvtrendFlat:",DoubleToStr(thvtrendFlat,4),";Buy|Coral: ",DoubleToStr(coral,4),";haOpen: ",haOpen,";ssa:",ssa,";ssb",ssb);
if((lasttrend == -1) || (lasttrend == 0)) //res=OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"THV ea",MAGICMA,0,Blue);
Alert("Buy Signal on ",Symbol()," -> ",Period());
lasttrend = 1;
return;
}
//=================END SELL/BUY CONDITIONS==========================
}
//+------------------------------------------------------------------+
//| Check for close order conditions |
//+------------------------------------------------------------------+
void CheckForClose()
{
int fasttrix = trix("fast");
double thvtrendDn = iCustom(NULL, 0, "THV3 trend",0,1);
double thvtrendUp = iCustom(NULL, 0, "THV3 trend",1,1);
double thvtrendFlat = iCustom(NULL, 0, "THV3 trend",2,1);
for(int i=0;i<OrdersTotal();i++)
{
if(OrderS elect(i,S ELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderMagicNumber()!=MAGICMA || OrderSymbol()!=Symbol()) continue;
// if((OrderType() == OP_BUY) && ((fasttrix == 2) || (thvtrendDn > 0)) )
if((OrderType() == OP_BUY) && ((fasttrix == 2) && (thvtrendDn > 0)) )
{
orderclosebuy(i);
return(0);
} // if((OrderType() == OP_SELL) && ((fasttrix == 1) || (thvtrendUp > 0)) )
else if((OrderType() == OP_SELL) && ((fasttrix == 1) && (thvtrendUp > 0)) )
{
orderclosesell(i);
return(0);
}
}
}
int orderclosebuy(int cnt)
{
string symbol = Symbol();
int ticketbuy;
double lotsbuy;
if(OrderS elect(cnt, S ELECT_BY_POS, MODE_TRADES))
{
ticketbuy = OrderTicket();
OrderS elect(ticketbuy, S ELECT_BY_TICKET, MODE_TRADES);
lotsbuy = OrderLots() ;
double bid = MarketInfo(symbol,MODE_BID);
RefreshRates();
OrderClose(ticketbuy,lotsbuy,bid,3,Magenta);
}
return(0);
}
int orderclosesell(int cnt)
{
string symbol = Symbol();
int ticketsell;
double lotssell;
if(OrderS elect(cnt, S ELECT_BY_POS, MODE_TRADES))
{
ticketsell = OrderTicket();
OrderS elect(ticketsell, S ELECT_BY_TICKET, MODE_TRADES);
lotssell = OrderLots() ;
double ask = MarketInfo(symbol,MODE_ASK);
RefreshRates();
OrderClose(ticketsell,lotssell,ask,3,Magenta);
}
return(0);
}
//=============== FUNCTION VALID TRADE TIME
bool F_ValidTradeTime (int iHour)
{
if(((iHour >= TradeFrom1) && (iHour <= (TradeUntil1-1)))||((iHour>= TradeFrom2) && (iHour <= (TradeUntil2-1)))||((iHour >= TradeFrom3)&& (iHour <= (TradeUntil3-1)))||((iHour >= TradeFrom4) && (iHour <=(TradeUntil4-1))))
{
return (true);
}
else
return (false);
}
void ModifyStopLoss(double ldStopLoss)
{
bool fm;
ldStopLoss = NormalizeDouble(ldStopLoss,5);
fm = OrderModify(OrderTicket(),OrderOpenPrice(),ldStopLoss,OrderTakeProfit(),0,CLR_NONE);
}
void TrailingPositionsBuy(int trailingStop) {
for (int i=0; i<OrdersTotal(); i++) {
if (OrderS elect(i, S ELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol()==Symbol()) {
if (OrderType()==OP_BUY) {
if (Bid-OrderOpenPrice()>trailingStop*Point) {
if (OrderStopLoss()<Bid-trailingStop*Point)
ModifyStopLoss(Bid-trailingStop*Point);
}
}
}
}
}
}
void TrailingPositionsSell(int trailingStop) {
for (int i=0; i<OrdersTotal(); i++) {
if (OrderS elect(i, S ELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol()==Symbol()) {
if (OrderType()==OP_SELL) {
if (OrderOpenPrice()-Ask>trailingStop*Point) {
if (OrderStopLoss()>Ask+trailingStop*Point ||
OrderStopLoss()==0)
ModifyStopLoss(Ask+trailingStop*Point);
}
}
}
}
}
}
void TrailingPositions()
{
for(int i=0;i<OrdersTotal();i++)
{
if(OrderS elect(i,S ELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderMagicNumber()!=MAGICMA || OrderSymbol()!=Symbol()) continue;
{
if(OrderType() == OP_BUY)
{
if(TrailingStop > 0)
{
if((Bid-OrderOpenPrice()) > (Point*TrailingStop))
{
if((OrderStopLoss()) < (Bid-Point*TrailingStop))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,GreenYellow);
return(0);
}
}
}
}
if(OrderType() == OP_SELL)
{
if(TrailingStop > 0)
{
if(OrderOpenPrice()-Ask>Point*TrailingStop)
{
if(OrderStopLoss()>Ask+Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
}
int trix(string mode)
{
double ftrix_0 = iCustom(NULL, 0, "THV3 Trix v4.01 Div", note1,HighLine_Color,ZeroLine_Color,LowLine_Color,Line_style,note2,text1Color,text2Color,text3Color,
MsgAlerts,SoundAlerts,eMailAlerts,AlertOnTrixCross,AlertOnTrixSigCross,AlertOnSlopeChange,
TrixCrossSound,AnalyzeLabelWindow,AnalyzeLabelonoff,Trixnum_bars,seperator2,NumberOfDivergenceBars,drawPriceTrendLines,
drawIndicatorTrendLines,ShowIn1MChart,_,EnableAlerts,_Info1,_Info2,_Info3,_Info4,
_Info5,_Info6,_Info7,_Info8,_Info9,_Info10,_Info11,SoundAlertOnDivergence,EmailDivergenceAlerts,__, BullishDivergenceColor, BearishDivergenceColor,___,ClassicBullDivSound,ReverseBullDivSound,ClassicBearDivSound,ReverseBearDivSound, 6, 1);
double ftrix_1 = iCustom(NULL, 0, "THV3 Trix v4.01 Div", note1,HighLine_Color,ZeroLine_Color,LowLine_Color,Line_style,note2,text1Color,text2Color,text3Color,
MsgAlerts,SoundAlerts,eMailAlerts,AlertOnTrixCross,AlertOnTrixSigCross,AlertOnSlopeChange,
TrixCrossSound,AnalyzeLabelWindow,AnalyzeLabelonoff,Trixnum_bars,seperator2,NumberOfDivergenceBars,drawPriceTrendLines,
drawIndicatorTrendLines,ShowIn1MChart,_,EnableAlerts,_Info1,_Info2,_Info3,_Info4,
_Info5,_Info6,_Info7,_Info8,_Info9,_Info10,_Info11,SoundAlertOnDivergence,EmailDivergenceAlerts,__, BullishDivergenceColor, BearishDivergenceColor,___,ClassicBullDivSound,ReverseBullDivSound,ClassicBearDivSound,ReverseBearDivSound, 6, 2);
double strix_0 = iCustom(NULL, 0, "THV3 Trix v4.01 Div", note1,HighLine_Color,ZeroLine_Color,LowLine_Color,Line_style,note2,text1Color,text2Color,text3Color,
MsgAlerts,SoundAlerts,eMailAlerts,AlertOnTrixCross,AlertOnTrixSigCross,AlertOnSlopeChange,
TrixCrossSound,AnalyzeLabelWindow,AnalyzeLabelonoff,Trixnum_bars,seperator2,NumberOfDivergenceBars,drawPriceTrendLines,
drawIndicatorTrendLines,ShowIn1MChart,_,EnableAlerts,_Info1,_Info2,_Info3,_Info4,
_Info5,_Info6,_Info7,_Info8,_Info9,_Info10,_Info11,SoundAlertOnDivergence,EmailDivergenceAlerts,__, BullishDivergenceColor, BearishDivergenceColor,___,ClassicBullDivSound,ReverseBullDivSound,ClassicBearDivSound,ReverseBearDivSound, 7, 1);
double strix_1 = iCustom(NULL, 0, "THV3 Trix v4.01 Div", note1,HighLine_Color,ZeroLine_Color,LowLine_Color,Line_style,note2,text1Color,text2Color,text3Color,
MsgAlerts,SoundAlerts,eMailAlerts,AlertOnTrixCross,AlertOnTrixSigCross,AlertOnSlopeChange,
TrixCrossSound,AnalyzeLabelWindow,AnalyzeLabelonoff,Trixnum_bars,seperator2,NumberOfDivergenceBars,drawPriceTrendLines,
drawIndicatorTrendLines,ShowIn1MChart,_,EnableAlerts,_Info1,_Info2,_Info3,_Info4,
_Info5,_Info6,_Info7,_Info8,_Info9,_Info10,_Info11,SoundAlertOnDivergence,EmailDivergenceAlerts,__, BullishDivergenceColor, BearishDivergenceColor,___,ClassicBullDivSound,ReverseBullDivSound,ClassicBearDivSound,ReverseBearDivSound, 7, 2);
if(mode == "fast")
{
if(ftrix_0 > ftrix_1) return(1);
if(ftrix_0 < ftrix_1) return(2);
}
if(mode == "slow")
{
if(strix_0 > strix_1) return(3);
if(strix_0 < strix_1) return(4);
}
return(0);
}
//http://www.extrafast.onpw.de/wp-content/2009/Experts/THV%20EA%20v2.mq4
// MMpriceTHV.mq4.mq4
//+------------------------------------------------------------------+
//| Magnified Market Price.mq4 ver1.4 by Habeeb |
//| Modified by FerruFX for Cobraforex THV System, www.cobraforex.com|
//+------------------------------------------------------------------+
#property indicator_chart_window
//----
extern string note1="Change font colors automatically? True = Yes";
extern bool Bid_Ask_Colors=True;
extern string note2="Default Font Color";
extern color FontColor=Black;
extern string note3="Font Size";
extern int FontSize=26;
extern string note4="Font Type";
extern string FontType="Rockwell";
extern string note5="Display the price in what corner?";
extern string note6="Upper left=0; Upper right=1";
extern string note7="Lower left=2; Lower right=3";
extern int WhatCorner=1;
//----
double Old_Price;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("Market_Price_Label");
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
if (Bid_Ask_Colors==True)
{
if (Bid > Old_Price) FontColor=Green;
if (Bid < Old_Price) FontColor=Red;
Old_Price=Bid;
}
//---- Define the standard digits
int digits;
string sub=StringSubstr(Symbol(), 3, 3);
if(sub == "JPY") digits = 2;
else digits = 4;
string Market_Price=DoubleToStr(Bid, digits);
//----
ObjectCreate("Market_Price_Label", OBJ_LABEL, 0, 0, 0);
ObjectSetText("Market_Price_Label", Market_Price, FontSize, FontType, FontColor);
ObjectSet("Market_Price_Label", OBJPROP_CORNER, WhatCorner);
ObjectSet("Market_Price_Label", OBJPROP_XDISTANCE, 1);
ObjectSet("Market_Price_Label", OBJPROP_YDISTANCE, 1);
}
//+------------------------------------------------------------------+
//T3_Trix.mq4
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| T3 TRIX (ROC of T6).mq4 |
//| convert FinGeR Alex orginal by Luis Damiani |
//| Modified by Cobraforex for THV System, www.cobraforex.com |
//+------------------------------------------------------------------+
#property copyright "convert FinGeR Alex orginal by Luis Damiani"
#property link ""
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 FireBrick
#property indicator_color2 Green
//---- input parameters
extern int A_t3_period=18;
extern int num_bars=350;
extern int is_A_open_price=0;
extern int B_t3_period_ac=8;
extern int diferential=0;
extern double hot=0.7;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int shift=0;
double A_t3=0,A_t3_1=0,max_per=0;
double B_t3=0,B_t3_1=0;
double e1=0,e2=0,e3=0,e4=0,e5=0,e6=0,c1=0,c2=0,c3=0,c4=0;
double e1x=0,e2x=0,e3x=0,e4x=0,e5x=0,e6x=0;
double d1=0,d2=0,d3=0,d4=0,d5=0,d6=0;
double d1x=0,d2x=0,d3x=0,d4x=0,d5x=0,d6x=0;
double n=0,A_w1=0,A_w2=0,B_w1=0,B_w2=0,b2=0,b3=0;
double init=true;
double bar=0, prevbars=0, start=0, cs=0, prevcs=0,frame=0;
string commodt="nonono";
int counted_bars=IndicatorCounted();
cs = num_bars+A_t3_period+is_A_open_price+B_t3_period_ac+diferential+hot;
if (cs==prevcs && commodt==Symbol() && frame==Time[4]-Time[5] && Bars-prevbars<2)
start=Bars-prevbars;
else start=-1;
commodt=Symbol();
frame=Time[4]-Time[5];
prevbars = Bars;
prevcs = cs;
if (start==1 || start==0) bar=start; else init=true;
if (init==true)
{
b2=hot*hot;
b3=b2*hot;
c1=-b3;
c2=(3*(b2+b3));
c3=-3*(2*b2+hot+b3);
c4=(1+3*hot+b3+3*b2);
n=A_t3_period;
if (n<1) n=1;
n = 1 + 0.5*(n-1);
A_w1 = 2 / (n + 1);
A_w2 = 1 - A_w1;
n=B_t3_period_ac;
if (n<1) n=1;
n = 1 + 0.5*(n-1);
B_w1 = 2 / (n + 1);
B_w2 = 1 - B_w1;
ExtMapBuffer1[num_bars-1]=0;
e1x=0;e2x=0;e3x=0;e4x=0;e5x=0;e6x=0;
ExtMapBuffer2[num_bars-1]=0;
d1x=0;d2x=0;d3x=0;d4x=0;d5x=0;d6x=0;
// max_per=max(A_t3_period,B_t3_period_ac);
bar=num_bars-2;
init=false;
}
//SetLoopCount(0);
shift=bar;
while(shift>=0)
{
if ( is_A_open_price==1 ) d1 = A_w1*Open[shift] + A_w2*d1x;
else d1 = A_w1*Close[shift] + A_w2*d1x;
d2 = A_w1*d1 + A_w2*d2x;
d3 = A_w1*d2 + A_w2*d3x;
d4 = A_w1*d3 + A_w2*d4x;
d5 = A_w1*d4 + A_w2*d5x;
d6 = A_w1*d5 + A_w2*d6x;
A_t3 = c1*d6 + c2*d5 + c3*d4 + c4*d3;
if ((start==1 && shift==1) || start==-1 )
{
d1x=d1;
d2x=d2;
d3x=d3;
d4x=d4;
d5x=d5;
d6x=d6;
}
e1 = B_w1*Close[shift] + B_w2*e1x;
e2 = B_w1*e1 + B_w2*e2x;
e3 = B_w1*e2 + B_w2*e3x;
e4 = B_w1*e3 + B_w2*e4x;
e5 = B_w1*e4 + B_w2*e5x;
e6 = B_w1*e5 + B_w2*e6x;
B_t3 = c1*e6 + c2*e5 + c3*e4 + c4*e3;
if(diferential==1)
{
ExtMapBuffer1[shift]=(A_t3-A_t3_1)/A_t3_1;
ExtMapBuffer2[shift]=(A_t3-A_t3_1)/A_t3_1+(B_t3-B_t3_1)/B_t3_1;
}
else
{
if ( B_t3_1 >0 && A_t3_1>0) {
ExtMapBuffer2[shift]=(B_t3-B_t3_1)/B_t3_1;
ExtMapBuffer1[shift]=(A_t3-A_t3_1)/A_t3_1;
}
//Comment("0");
}
//Comment(" start: ",start," bar: ",bar,"
",
//"frame: ",frame," num_bars:" ,num_bars," commodity: ",commodt ,"
",(B_t3-B_t3_1)/B_t3_1);
if ((start==1 && shift==1) || start==-1)
{
//Comment("Bar=ghfghfgh");
A_t3_1=A_t3;
B_t3_1=B_t3;
e1x=e1;
e2x=e2;
e3x=e3;
e4x=e4;
e5x=e5;
e6x=e6;
}
shift--;
//Comment("View !!! NO?????");
}
//----
}
//+------------------------------------------------------------------+
// http://instaforex.rxfly.net/indikatori/sbornik_indikatorov_chast_4/T3%20TRIX%20THV.mq4
2012-07-14
1883
글번호 52888
답변완료
문의 드립니다.
1. if crossup(a,b) then {}
2. if a >= b then{}
1번식과 2번식의 차이가 있나요?
2012-07-14
357
글번호 52887
답변완료
복합챠트에서 수식문의 드려요
복합챠트에서 정규장, CME야선별로 각각 "시가, 종가, 중간값"을 선으로 표현하고자 합니다. 도움부탁드립니다
2012-07-13
374
글번호 52886
하얀모래 님에 의해서 삭제되었습니다.
2012-07-13
22
글번호 52885