Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

FOREXPIPBRO

Convert Mt4 to Tradstation

Recommended Posts

Below is what I believe to be an open code for the Steinitz fractal breakout strategy. I would like to know if its possible to translate this into easylanguage for tradestation. Please let me know if this is going to work, thank you

 

 

#property indicator_chart_window

#property indicator_buffers 7

#property indicator_color1 LawnGreen

#property indicator_color2 Red

#property indicator_color3 Red

#property indicator_color4 Blue

#property indicator_color5 Orange

#property indicator_color6 Red

#property indicator_color7 LawnGreen

 

int gi_76 = 67890;

extern int YourAccountNumber = 12345;

bool gi_84 = FALSE;

int gi_88 = 12;

int gi_92 = 31;

int gi_96 = 2008;

extern bool Alert_SoundON = TRUE;

extern bool EmailON = FALSE;

extern bool ShowTradeArrowsOnly = TRUE;

extern bool ShowBuySellLines = TRUE;

extern bool ShowBadTradeExits = TRUE;

extern bool ShowFibProfitTargets = TRUE;

extern int MA_Period = 50;

extern string m = "--Moving Average Types--";

extern string m0 = " 0 = SMA";

extern string m1 = " 1 = EMA";

extern string m2 = " 2 = SMMA";

extern string m3 = " 3 = LWMA";

extern int MA_Type = 0;

extern string p = "--Applied Price Types--";

extern string p0 = " 0 = close";

extern string p1 = " 1 = open";

extern string p2 = " 2 = high";

extern string p3 = " 3 = low";

extern string p4 = " 4 = median(high+low)/2";

extern string p5 = " 5 = typical(high+low+close)/3";

extern string p6 = " 6 = weighted(high+low+close+close)/4";

extern int MA_AppliedPrice = 4;

extern double AngleTreshold = 0.25;

extern int PrevMAShift = 2;

extern int CurMAShift = 0;

int g_ma_method_256 = MODE_SMA;

bool gi_260 = TRUE;

bool gi_264 = TRUE;

extern string pg0 = "Bad Trade Exits";

extern string pg = "Price Gap inputs";

extern int PriceGapMN = 100;

extern int PriceGapW1 = 60;

extern int PriceGapD1 = 40;

extern int PriceGapH4 = 25;

extern int PriceGapH1 = 20;

extern int PriceGapM30 = 15;

extern int PriceGapM15 = 10;

extern int PriceGapM5 = 5;

extern int PriceGapM1 = 3;

extern string fp = "Face Position";

extern int FacePosMN = 80;

extern int FacePosW1 = 60;

extern int FacePosD1 = 48;

extern int FacePosH4 = 24;

extern int FacePosH1 = 16;

extern int FacePosM30 = 10;

extern int FacePosM15 = 8;

extern int FacePosM5 = 4;

extern int FacePosM1 = 4;

extern string tp12 = "Fib Retrace Inputs";

extern int BarsBack = 10;

extern double FibRetraceTrade1 = 100.0;

extern double FibRetraceTrade2 = 161.8;

extern double FibRetraceTrade3 = 261.8;

extern bool AddSpreadToTargets = TRUE;

extern string ap = "Arrow Position";

extern int Arrow_Position = 5;

extern string to = "---Text Object Settings---";

extern int Text_X_Offset = 20;

extern int StatusTxtSize = 10;

extern color StatusColor = White;

extern int CommentTxtSize = 10;

extern color CommentColor = White;

extern color BuyLineColor = Aqua;

extern color SellLineColor = Yellow;

extern color Fib1Color = Pink;

extern color Fib2Color = Orange;

extern color Fib3Color = Red;

int g_datetime_464;

double g_ibuf_468[];

double g_ibuf_472[];

double g_ibuf_476[];

double g_ibuf_480[];

double g_ibuf_484[];

double g_ibuf_488[];

double g_ibuf_492[];

double gd_496;

double gd_504;

string gs_512 = "";

string gs_520;

string gs_528;

int g_datetime_536;

bool g_global_var_540;

bool g_global_var_544;

int gi_548;

int gi_552;

int gi_556;

string gs_560;

string gs_568;

string gs_576;

string gs_584 = "Steinitz Fractal Breakout Status";

int gi_592;

bool gi_596 = FALSE;

string gs_600 = "_SFBInd15_";

bool gi_608;

bool gi_612;

double gd_616;

double gd_624;

double g_ima_632;

double g_ima_640;

double gd_648;

double gd_656;

double gd_664;

double gd_672;

double g_ilow_680;

double g_ihigh_688;

double gd_696;

double gd_704;

double gd_712;

int g_time_720 = 0;

int g_time_724 = 0;

int g_time_728 = 0;

int gi_732 = 0;

int gi_736;

string g_var_name_740;

string g_var_name_748;

string g_var_name_756;

string g_var_name_764;

string g_var_name_772;

string g_var_name_780;

string g_var_name_788;

string g_var_name_796;

string g_var_name_804;

string g_var_name_812;

string g_var_name_820;

string g_var_name_828;

string g_var_name_836;

string g_var_name_844;

string g_var_name_852;

bool gi_860 = TRUE;

 

int init() {

string ls_0;

string ls_8;

string ls_16;

bool li_24;

string l_name_36;

SetIndexStyle(0, DRAW_ARROW, EMPTY);

SetIndexArrow(0, 233);

SetIndexBuffer(0, g_ibuf_468);

SetIndexStyle(1, DRAW_ARROW, EMPTY);

SetIndexArrow(1, 234);

SetIndexBuffer(1, g_ibuf_472);

SetIndexStyle(2, DRAW_LINE, STYLE_SOLID);

SetIndexBuffer(2, g_ibuf_476);

SetIndexStyle(3, DRAW_LINE, STYLE_SOLID);

SetIndexBuffer(3, g_ibuf_480);

SetIndexStyle(4, DRAW_LINE, STYLE_SOLID);

SetIndexBuffer(4, g_ibuf_484);

SetIndexStyle(5, DRAW_ARROW, EMPTY);

SetIndexArrow(5, 76);

SetIndexBuffer(5, g_ibuf_492);

SetIndexStyle(6, DRAW_ARROW, EMPTY);

SetIndexArrow(6, 76);

SetIndexBuffer(6, g_ibuf_488);

if (MA_Type >= 4) li_24 = FALSE;

else li_24 = MA_Type;

switch (li_24) {

case 0:

g_ma_method_256 = 0;

ls_0 = "sma10";

ls_8 = "sma21";

ls_16 = "sma50";

break;

case 1:

g_ma_method_256 = 1;

ls_0 = "ema10";

ls_8 = "ema21";

ls_16 = "ema50";

break;

case 2:

g_ma_method_256 = 2;

ls_0 = "smma10";

ls_8 = "smma21";

ls_16 = "smma50";

break;

case 3:

g_ma_method_256 = 3;

ls_0 = "lwma10";

ls_8 = "lwma21";

ls_16 = "lwma50";

break;

default:

g_ma_method_256 = 0;

ls_0 = "sma10";

ls_8 = "sma21";

ls_16 = "sma50";

}

SetIndexLabel(2, ls_0);

SetIndexLabel(3, ls_8);

SetIndexLabel(4, ls_16);

gd_496 = Get_mFactor();

gi_596 = FALSE;

ClearArrows();

DeleteBadLabels();

if (IsDemo() == TRUE) gi_596 = TRUE;

if (gi_596 == FALSE) gi_596 = CheckAccountNumber();

if (gi_596 == TRUE) {

DeleteExistingLabels();

SetupLabels();

ClearLabels();

gd_504 = SetPoint();

g_global_var_540 = FALSE;

g_global_var_544 = FALSE;

OutputStatusToChart(gs_584 + " INITIALIZED SUCCESSFULLY");

if (gi_84 == TRUE) OutputComment1ToChart("Expires on " + gi_88 + "/" + gi_92 + "/" + gi_96);

else OutputComment1ToChart("No expiration");

}

if (CurMAShift >= PrevMAShift) {

Print("Error: CurMAShift >= PrevMAShift");

PrevMAShift = 6;

CurMAShift = 0;

}

GetGlobalVars();

DeleteFractObjects();

DeleteBadLabels();

int l_objs_total_32 = ObjectsTotal();

for (int li_44 = 0; li_44 < l_objs_total_32; li_44++) {

l_name_36 = ObjectName(li_44);

Print(li_44, "Object name for object #", li_44, " is " + l_name_36);

}

return (0);

}

 

int deinit() {

ClearLabels();

DeleteExistingLabels();

ClearArrows();

DeleteFractObjects();

return (0);

}

 

int FibRetracement(int ai_0, int ai_4) {

int li_ret_16;

int l_highest_8 = iHighest(NULL, 0, MODE_HIGH, BarsBack, ai_4);

int l_lowest_12 = iLowest(NULL, 0, MODE_LOW, BarsBack, ai_4);

g_ihigh_688 = iHigh(NULL, 0, l_highest_8);

g_ilow_680 = iLow(NULL, 0, l_lowest_12);

if (ai_0 == 0)

if (g_ihigh_688 > g_ilow_680) li_ret_16 = MathFloor((g_ihigh_688 - g_ilow_680) / gd_504);

if (ai_0 == 1)

if (g_ilow_680 < g_ihigh_688) li_ret_16 = MathFloor((g_ihigh_688 - g_ilow_680) / gd_504);

return (li_ret_16);

}

 

void FibLines(int ai_0, int ai_4) {

int li_8 = MarketInfo(Symbol(), MODE_SPREAD);

if (Digits == 3 || Digits == 5) li_8 /= 10;

int li_12 = FibRetracement(ai_0, ai_4);

if (ai_0 == 0) {

gd_696 = g_ilow_680 + li_12 * FibRetraceTrade1 / 100.0 * gd_504;

if (AddSpreadToTargets) gd_696 += li_8 * gd_504;

SaveFib1(gd_696);

gd_704 = g_ilow_680 + li_12 * FibRetraceTrade2 / 100.0 * gd_504;

if (AddSpreadToTargets) gd_704 += li_8 * gd_504;

SaveFib2(gd_704);

gd_712 = g_ilow_680 + li_12 * FibRetraceTrade3 / 100.0 * gd_504;

if (AddSpreadToTargets) gd_712 += li_8 * gd_504;

SaveFib3(gd_712);

}

if (ai_0 == 1) {

gd_696 = g_ihigh_688 - li_12 * FibRetraceTrade1 / 100.0 * gd_504;

if (AddSpreadToTargets) gd_696 -= li_8 * gd_504;

SaveFib1(gd_696);

gd_704 = g_ihigh_688 - li_12 * FibRetraceTrade2 / 100.0 * gd_504;

if (AddSpreadToTargets) gd_704 -= li_8 * gd_504;

SaveFib2(gd_704);

gd_712 = g_ihigh_688 - li_12 * FibRetraceTrade3 / 100.0 * gd_504;

if (AddSpreadToTargets) gd_712 -= li_8 * gd_504;

SaveFib3(gd_712);

}

RemoveLine("Fib1");

RemoveLine("Fib2");

RemoveLine("Fib3");

DisplayLine("Fib1", gd_696, Fib1Color);

DisplayLine("Fib2", gd_704, Fib2Color);

DisplayLine("Fib3", gd_712, Fib3Color);

}

 

int start() {

int li_8;

int li_12;

int li_16 = IndicatorCounted();

DeleteBadLabels();

if (gi_552 < 10) {

SetupLabels();

ClearLabels();

DeleteExistingLabels();

SetupLabels();

}

if (gi_596 == FALSE) return (0);

gi_592 = CheckTradeFilters();

if (gi_592 == 1) return (0);

if (li_16 < 0) return (-1);

if (li_16 > 0) li_16--;

int li_0 = Bars - li_16;

if (gi_860) {

ClearArrows();

gi_860 = FALSE;

}

for (int li_4 = li_0 - 1; li_4 >= 0; li_4--) {

GetMAs(li_4 + 1);

gi_608 = FALSE;

SaveBuy(gi_608);

gi_612 = FALSE;

SaveSell(gi_612);

CheckMA_Angle(li_4 + 1);

CheckHighLowRules(li_4 + 1);

CheckMAs();

if (gi_608) {

gd_616 = iHigh(NULL, 0, li_4 + 1);

SaveBuy1(gd_616);

}

if (gi_612) {

gd_624 = iLow(NULL, 0, li_4 + 1);

SaveSell1(gd_624);

}

if (ShowTradeArrowsOnly) {

if (gi_608) {

if (iHigh(NULL, 0, li_4) <= gd_616) {

gi_608 = FALSE;

SaveBuy(gi_608);

}

}

if (gi_612) {

if (iLow(NULL, 0, li_4) >= gd_624) {

gi_612 = FALSE;

SaveSell(gi_612);

}

}

}

if (gi_608) {

if (li_4 == 0) {

if (ShowTradeArrowsOnly) {

if (NewTradeBar()) ShowAlert("Buy Trade ");

} else

if (NewSignalBar()) ShowAlert("Buy Alert ");

}

li_8 = MathRound((High[li_4 + 1] - gd_672) / gd_504);

if (ShowTradeArrowsOnly) gs_528 = GetSignalTime(li_4, 1);

else gs_528 = GetSignalTime(li_4 + 1, 0);

gs_512 = gs_520 + " - D:" + li_8 + " A:" + DoubleToStr(gd_648, 2) + " at " + gs_528;

OutputComment2ToChart(gs_512);

if (ShowTradeArrowsOnly) {

g_ibuf_468[li_4] = iLow(NULL, 0, li_4) - Arrow_Position * gd_504;

if (ShowFibProfitTargets) FibLines(0, li_4 + 1);

} else g_ibuf_468[li_4 + 1] = iLow(NULL, 0, li_4 + 1) - Arrow_Position * gd_504;

g_global_var_540 = FALSE;

SaveLastArrow(0);

g_global_var_544 = TRUE;

SaveLastSmile(1);

g_datetime_464 = Time[0];

if (ShowBuySellLines) {

DisplayLine("FractBuy", gd_616, BuyLineColor);

RemoveLine("FractSell");

}

} else {

if (gi_612) {

if (li_4 == 0) {

if (ShowTradeArrowsOnly) {

if (NewTradeBar()) ShowAlert("Sell Trade ");

} else

if (NewSignalBar()) ShowAlert("Sell Alert ");

}

li_8 = MathRound((gd_672 - (Low[li_4 + 1])) / gd_504);

if (ShowTradeArrowsOnly) gs_528 = GetSignalTime(li_4, 1);

else gs_528 = GetSignalTime(li_4 + 1, 0);

gs_512 = gs_520 + " - D:" + li_8 + " A:" + DoubleToStr(gd_648, 2) + " at " + gs_528;

OutputComment2ToChart(gs_512);

if (ShowTradeArrowsOnly) {

g_ibuf_472[li_4] = iHigh(NULL, 0, li_4) + Arrow_Position * gd_504;

if (ShowFibProfitTargets) FibLines(1, li_4 + 1);

} else g_ibuf_472[li_4 + 1] = iHigh(NULL, 0, li_4 + 1) + Arrow_Position * gd_504;

g_global_var_540 = TRUE;

SaveLastArrow(1);

g_global_var_544 = FALSE;

SaveLastSmile(0);

g_datetime_464 = Time[0];

if (ShowBuySellLines) {

DisplayLine("FractSell", gd_624, SellLineColor);

RemoveLine("FractBuy");

}

}

}

if (ShowBadTradeExits) {

if (g_global_var_540 == 0) {

if (g_global_var_544 != 0) {

if (CheckBadExit(0, li_4 + 1)) {

li_12 = GetFacePos(Period());

g_ibuf_488[li_4 + 1] = iLow(NULL, 0, li_4 + 1) - li_12 * gd_504;

g_global_var_544 = FALSE;

SaveLastSmile(0);

if (li_4 == 0)

if (NewBadTradeBar()) ShowAlert("BUY Trade Exit");

}

}

}

if (g_global_var_540 == 1) {

if (g_global_var_544 != 1) {

if (CheckBadExit(1, li_4 + 1)) {

li_12 = GetFacePos(Period());

g_ibuf_492[li_4 + 1] = iHigh(NULL, 0, li_4 + 1) + li_12 * gd_504;

g_global_var_544 = TRUE;

SaveLastSmile(1);

if (li_4 == 0)

if (NewBadTradeBar()) ShowAlert("SELL Trade Exit");

}

}

}

}

}

return (0);

}

 

double Get_mFactor() {

double ld_ret_8 = 10000.0;

string ls_0 = StringSubstr(Symbol(), 3, 3);

if (ls_0 == "JPY") ld_ret_8 = 100.0;

int li_16 = PrevMAShift - CurMAShift;

ld_ret_8 /= li_16;

return (ld_ret_8);

}

 

bool NewSignalBar() {

if (g_time_720 == Time[0]) return (FALSE);

g_time_720 = Time[0];

return (TRUE);

}

 

bool NewTradeBar() {

if (g_time_724 == Time[0]) return (FALSE);

g_time_724 = Time[0];

return (TRUE);

}

 

bool NewBadTradeBar() {

if (g_time_728 == Time[0]) return (FALSE);

g_time_728 = Time[0];

return (TRUE);

}

 

void GetMAs(int ai_0) {

gd_656 = iMA(NULL, 0, 10, 0, g_ma_method_256, PRICE_CLOSE, ai_0);

gd_664 = iMA(NULL, 0, 21, 0, g_ma_method_256, PRICE_CLOSE, ai_0);

gd_672 = iMA(NULL, 0, 50, 0, g_ma_method_256, PRICE_CLOSE, ai_0);

g_ibuf_476[ai_0] = gd_656;

g_ibuf_480[ai_0] = gd_664;

g_ibuf_484[ai_0] = gd_672;

SaveMA10(gd_656);

SaveMA21(gd_664);

SaveMA50(gd_672);

}

 

void CheckMA_Angle(int ai_0) {

g_ima_632 = iMA(NULL, 0, MA_Period, 0, g_ma_method_256, MA_AppliedPrice, ai_0 + CurMAShift);

g_ima_640 = iMA(NULL, 0, MA_Period, 0, g_ma_method_256, MA_AppliedPrice, ai_0 + PrevMAShift);

gd_648 = gd_496 * (g_ima_632 - g_ima_640) / 2.0;

gd_648 = NormalizeDouble(gd_648, 2);

SavefAngle(gd_648);

if (gd_648 > AngleTreshold) {

gi_608 = TRUE;

SaveBuy(gi_608);

gs_520 = "BUY";

return;

}

if (gd_648 < -AngleTreshold) {

gi_612 = TRUE;

SaveSell(gi_612);

gs_520 = "SELL";

}

}

 

void CheckHighLowRules(int ai_0) {

if (gi_260 == TRUE) {

if (gi_608) {

if (Low[ai_0] > gd_656) {

gi_608 = FALSE;

SaveBuy(gi_608);

}

}

if (gi_612) {

if (High[ai_0] < gd_656) {

gi_612 = FALSE;

SaveSell(gi_612);

}

}

}

if (gi_264 == TRUE) {

if (gi_608) {

if (High[ai_0] > High[ai_0 + 1]) {

gi_608 = FALSE;

SaveBuy(gi_608);

}

}

if (gi_612) {

if (Low[ai_0] < Low[ai_0 + 1]) {

gi_612 = FALSE;

SaveSell(gi_612);

}

}

}

}

 

void CheckMAs() {

if (gi_608) {

if (gd_656 <= gd_672 || gd_664 <= gd_672) {

gi_608 = FALSE;

SaveBuy(gi_608);

}

}

if (gi_612) {

if (gd_656 >= gd_672 || gd_664 >= gd_672) {

gi_612 = FALSE;

SaveSell(gi_612);

}

}

}

 

string GetSignalTime(int ai_0, bool ai_4) {

if (ai_4) {

if (gi_732 != iTime(NULL, 0, ai_0)) {

g_datetime_536 = TimeCurrent();

gi_736 = g_datetime_536;

SaveLastTradeSignalTime(g_datetime_536);

gi_732 = iTime(NULL, 0, ai_0);

SaveTradeCandleOpenTime(gi_732);

} else g_datetime_536 = gi_736;

} else g_datetime_536 = iTime(NULL, 0, ai_0);

string ls_ret_8 = TimeToStr(g_datetime_536, TIME_DATE) + " " + TimeHour(g_datetime_536) + ":";

if (TimeMinute(g_datetime_536) < 10) ls_ret_8 = ls_ret_8 + "0";

ls_ret_8 = ls_ret_8 + TimeMinute(g_datetime_536);

return (ls_ret_8);

}

 

int GetFacePos(int ai_0) {

int li_ret_4 = 0;

switch (ai_0) {

case 43200:

li_ret_4 = FacePosMN;

break;

case 10080:

li_ret_4 = FacePosW1;

break;

case 1440:

li_ret_4 = FacePosD1;

break;

case 240:

li_ret_4 = FacePosH4;

break;

case 60:

li_ret_4 = FacePosH1;

break;

case 30:

li_ret_4 = FacePosM30;

break;

case 15:

li_ret_4 = FacePosM15;

break;

case 5:

li_ret_4 = FacePosM5;

break;

case 1:

li_ret_4 = FacePosM1;

break;

default:

li_ret_4 = 5;

}

return (li_ret_4);

}

 

void ShowAlert(string as_0) {

string ls_8 = TimeToStr(TimeCurrent(), TIME_DATE) + " " + TimeHour(TimeCurrent()) + ":";

if (TimeMinute(TimeCurrent()) < 10) ls_8 = ls_8 + "0";

ls_8 = ls_8 + TimeMinute(TimeCurrent());

if (Alert_SoundON) Alert(as_0, Symbol(), " on ", tf2txt(Period()), " ", ls_8, " Steinitz");

if (EmailON) SendMail(as_0 + Symbol(), "Date=" + ls_8 + " on " + tf2txt(Period()));

}

 

void ClearArrows() {

for (int li_0 = Bars; li_0 >= 0; li_0--) {

g_ibuf_472[li_0] = 0;

g_ibuf_468[li_0] = 0;

g_ibuf_492[li_0] = 0;

g_ibuf_488[li_0] = 0;

}

}

 

int CheckTradeFilters() {

bool li_4;

bool li_ret_0 = FALSE;

if (gi_84 == TRUE) {

li_4 = FALSE;

if (Year() > gi_96) li_4 = TRUE;

if (li_4 == FALSE) {

if (Year() == gi_96 && Month() > gi_88) li_4 = TRUE;

if (li_4 == FALSE)

if (Year() == gi_96 && Month() == gi_88 && Day() > gi_92) li_4 = TRUE;

}

if (li_4 == TRUE) OutputComment1ToChart("Indicator has expired - renew license");

li_ret_0 = li_4;

}

return (li_ret_0);

}

 

double SetPoint() {

double ld_ret_0;

if (Digits < 4) ld_ret_0 = 0.01;

else ld_ret_0 = 0.0001;

return (ld_ret_0);

}

 

int CheckAccountNumber() {

if (YourAccountNumber == AccountNumber() && YourAccountNumber == gi_76) return (1);

Alert("AccountNumber entered is incorrect.\n You entered ", YourAccountNumber);

return (0);

}

 

void ClearLabels() {

string ls_0 = " ";

OutputLabelToChart(gs_560, gi_548, StatusTxtSize, StatusColor, ls_0, " ");

OutputLabelToChart(gs_568, gi_552, CommentTxtSize, CommentColor, ls_0, " ");

OutputLabelToChart(gs_576, gi_556, CommentTxtSize, CommentColor, ls_0, " ");

}

 

void DeleteBadLabels() {

string l_name_8;

int l_objs_total_4 = ObjectsTotal();

if (l_objs_total_4 > 0) {

for (int li_0 = l_objs_total_4 - 1; li_0 >= 0; li_0--) {

l_name_8 = ObjectName(li_0);

if (StringFind(l_name_8, Symbol(), 0) < 0)

if (StringFind(l_name_8, gs_600, 0) >= 0) ObjectDelete(l_name_8);

}

}

}

 

void DeleteExistingLabels() {

string l_name_4;

int l_objs_total_0 = ObjectsTotal(OBJ_LABEL);

if (l_objs_total_0 > 0) {

for (int l_objs_total_12 = l_objs_total_0; l_objs_total_12 >= 0; l_objs_total_12--) {

l_name_4 = ObjectName(l_objs_total_12);

if (StringFind(l_name_4, Symbol() + gs_600 + "FractalStatus", 0) >= 0) ObjectDelete(l_name_4);

else

if (StringFind(l_name_4, Symbol() + gs_600 + "FractalComment", 0) >= 0) ObjectDelete(l_name_4);

}

}

}

 

void SetupLabels() {

gi_548 = 12;

gi_552 = gi_548 + StatusTxtSize + 4;

gi_556 = gi_552 + CommentTxtSize + 4;

gs_560 = Symbol() + gs_600 + "FractalStatus";

gs_568 = Symbol() + gs_600 + "FractalComment1";

gs_576 = Symbol() + gs_600 + "FractalComment2";

}

 

void OutputLabelToChart(string a_name_0, int a_y_8, int a_fontsize_12, color a_color_16, string a_text_20, string as_unused_28) {

if (ObjectFind(a_name_0) != 0) {

ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0);

ObjectSet(a_name_0, OBJPROP_CORNER, 0);

ObjectSet(a_name_0, OBJPROP_XDISTANCE, Text_X_Offset);

ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_8);

}

ObjectSetText(a_name_0, a_text_20, a_fontsize_12, "Arial Bold", a_color_16);

}

 

void OutputStatusToChart(string as_0) {

OutputLabelToChart(gs_560, gi_548, StatusTxtSize, StatusColor, as_0, "*");

}

 

void OutputComment1ToChart(string as_0) {

OutputLabelToChart(gs_568, gi_552, CommentTxtSize, CommentColor, as_0, "*");

}

 

void OutputComment2ToChart(string as_0) {

OutputLabelToChart(gs_576, gi_556, CommentTxtSize, CommentColor, as_0, "*");

}

 

string tf2txt(int ai_0) {

switch (ai_0) {

case 1:

return ("M1");

case 5:

return ("M5");

case 15:

return ("M15");

case 30:

return ("M30");

case 60:

return ("H1");

case 240:

return ("H4");

case 1440:

return ("D1");

case 10080:

return ("W1");

case 43200:

return ("MN");

}

return ("??");

}

 

void DisplayLine(string as_0, double a_price_8, color a_color_16) {

string l_name_20 = Symbol() + gs_600 + as_0;

if (ObjectFind(l_name_20) != 0) {

ObjectCreate(l_name_20, OBJ_HLINE, 0, g_datetime_464, a_price_8);

ObjectSet(l_name_20, OBJPROP_STYLE, STYLE_DASHDOTDOT);

ObjectSet(l_name_20, OBJPROP_COLOR, a_color_16);

ObjectSet(l_name_20, OBJPROP_WIDTH, 1);

return;

}

ObjectMove(l_name_20, 0, g_datetime_464, a_price_8);

}

 

void DeleteFractObjects() {

ObjectDelete(Symbol() + gs_600 + "FractBuy");

ObjectDelete(Symbol() + gs_600 + "FractSell");

ObjectDelete(Symbol() + gs_600 + "Fib1");

ObjectDelete(Symbol() + gs_600 + "Fib2");

ObjectDelete(Symbol() + gs_600 + "Fib3");

}

 

void RemoveLine(string as_0) {

ObjectDelete(Symbol() + gs_600 + as_0);

}

 

bool CheckBadExit(int ai_0, int ai_4) {

double l_iopen_24 = iOpen(NULL, 0, ai_4);

double l_iclose_40 = iClose(NULL, 0, ai_4);

double l_iopen_32 = iOpen(NULL, 0, ai_4 + 1);

double l_iclose_48 = iClose(NULL, 0, ai_4 + 1);

double l_ima_8 = iMA(NULL, 0, 50, 0, g_ma_method_256, PRICE_CLOSE, ai_4);

double l_ima_16 = iMA(NULL, 0, 50, 0, g_ma_method_256, PRICE_CLOSE, ai_4 + 1);

int li_56 = GetPriceGap(Period());

double ld_60 = li_56 * gd_504;

if (Digits < 3) {

ld_60 = NormalizeDouble(ld_60, 2);

l_iopen_24 = NormalizeDouble(l_iopen_24, 2);

l_iclose_40 = NormalizeDouble(l_iclose_40, 2);

l_iopen_32 = NormalizeDouble(l_iopen_32, 2);

l_iclose_48 = NormalizeDouble(l_iclose_48, 2);

l_ima_8 = NormalizeDouble(l_ima_8, 2);

l_ima_16 = NormalizeDouble(l_ima_16, 2);

} else {

ld_60 = NormalizeDouble(ld_60, 4);

l_iopen_24 = NormalizeDouble(l_iopen_24, 4);

l_iclose_40 = NormalizeDouble(l_iclose_40, 4);

l_iopen_32 = NormalizeDouble(l_iopen_32, 4);

l_iclose_48 = NormalizeDouble(l_iclose_48, 4);

l_ima_8 = NormalizeDouble(l_ima_8, 4);

l_ima_16 = NormalizeDouble(l_ima_16, 4);

}

switch (ai_0) {

case 0:

if (l_iopen_24 > l_iclose_40) {

if (l_iopen_32 > l_iclose_48) {

if (l_iclose_40 + ld_60 <= l_ima_8)

if (l_iclose_48 + ld_60 <= l_ima_16) return (TRUE);

}

}

case 1:

if (l_iopen_24 < l_iclose_40) {

if (l_iopen_32 < l_iclose_48) {

if (l_iclose_40 - ld_60 >= l_ima_8)

if (l_iclose_48 - ld_60 >= l_ima_16) return (TRUE);

}

}

}

return (FALSE);

}

 

int GetPriceGap(int ai_0) {

int li_ret_4 = 0;

switch (ai_0) {

case 43200:

li_ret_4 = PriceGapMN;

break;

case 10080:

li_ret_4 = PriceGapW1;

break;

case 1440:

li_ret_4 = PriceGapD1;

break;

case 240:

li_ret_4 = PriceGapH4;

break;

case 60:

li_ret_4 = PriceGapH1;

break;

case 30:

li_ret_4 = PriceGapM30;

break;

case 15:

li_ret_4 = PriceGapM15;

break;

case 5:

li_ret_4 = PriceGapM5;

break;

case 1:

li_ret_4 = PriceGapM1;

break;

default:

li_ret_4 = 5;

}

return (li_ret_4);

}

 

void GetGlobalVars() {

NameGlobalVars();

InitGlobalVars();

GetGlobalVarValues();

}

 

void GetGlobalVarValues() {

double l_global_var_0 = GlobalVariableGet(g_var_name_740);

if (l_global_var_0 > 0.0) gi_608 = TRUE;

else gi_608 = FALSE;

l_global_var_0 = GlobalVariableGet(g_var_name_748);

if (l_global_var_0 > 0.0) gi_612 = TRUE;

else gi_612 = FALSE;

gd_616 = GlobalVariableGet(g_var_name_756);

gd_624 = GlobalVariableGet(g_var_name_764);

gd_656 = GlobalVariableGet(g_var_name_772);

gd_664 = GlobalVariableGet(g_var_name_780);

gd_672 = GlobalVariableGet(g_var_name_788);

gd_648 = GlobalVariableGet(g_var_name_796);

gi_732 = GlobalVariableGet(g_var_name_804);

gi_736 = GlobalVariableGet(g_var_name_812);

g_global_var_540 = GlobalVariableGet(g_var_name_820);

g_global_var_544 = GlobalVariableGet(g_var_name_828);

gd_696 = GlobalVariableGet(g_var_name_836);

gd_704 = GlobalVariableGet(g_var_name_844);

gd_712 = GlobalVariableGet(g_var_name_852);

}

 

void InitGlobalVars() {

if (!GlobalVariableCheck(g_var_name_740)) GlobalVariableSet(g_var_name_740, -10);

if (!GlobalVariableCheck(g_var_name_748)) GlobalVariableSet(g_var_name_748, -10);

if (!GlobalVariableCheck(g_var_name_756)) GlobalVariableSet(g_var_name_756, 0);

if (!GlobalVariableCheck(g_var_name_764)) GlobalVariableSet(g_var_name_764, 0);

if (!GlobalVariableCheck(g_var_name_772)) GlobalVariableSet(g_var_name_772, 0);

if (!GlobalVariableCheck(g_var_name_780)) GlobalVariableSet(g_var_name_780, 0);

if (!GlobalVariableCheck(g_var_name_788)) GlobalVariableSet(g_var_name_788, 0);

if (!GlobalVariableCheck(g_var_name_796)) GlobalVariableSet(g_var_name_796, 0);

if (!GlobalVariableCheck(g_var_name_804)) GlobalVariableSet(g_var_name_804, 0);

if (!GlobalVariableCheck(g_var_name_812)) GlobalVariableSet(g_var_name_812, 0);

if (!GlobalVariableCheck(g_var_name_820)) GlobalVariableSet(g_var_name_820, 10);

if (!GlobalVariableCheck(g_var_name_828)) GlobalVariableSet(g_var_name_828, 10);

if (!GlobalVariableCheck(g_var_name_836)) GlobalVariableSet(g_var_name_836, 0);

if (!GlobalVariableCheck(g_var_name_844)) GlobalVariableSet(g_var_name_844, 0);

if (!GlobalVariableCheck(g_var_name_852)) GlobalVariableSet(g_var_name_852, 0);

}

 

void NameGlobalVars() {

string ls_0 = "SFBI_15_" + Symbol() + tf2txt(Period());

g_var_name_740 = ls_0 + "_Buy";

g_var_name_748 = ls_0 + "_Sell";

g_var_name_756 = ls_0 + "_BuyLine";

g_var_name_764 = ls_0 + "_SellLine";

g_var_name_772 = ls_0 + "_MA10";

g_var_name_780 = ls_0 + "_MA21";

g_var_name_788 = ls_0 + "_MA50";

g_var_name_796 = ls_0 + "_fAngle";

g_var_name_804 = ls_0 + "_TradeCandleOT";

g_var_name_812 = ls_0 + "_LastTradeCandleST";

g_var_name_820 = ls_0 + "_LastArrow";

g_var_name_828 = ls_0 + "_LastSmile";

g_var_name_836 = ls_0 + "_Fib1";

g_var_name_844 = ls_0 + "_Fib2";

g_var_name_852 = ls_0 + "_Fib3";

}

 

void SaveBuy(int ai_0) {

if (ai_0 == 1) {

GlobalVariableSet(g_var_name_740, 10.0);

return;

}

GlobalVariableSet(g_var_name_740, -10.0);

}

 

void SaveSell(int ai_0) {

if (ai_0 == 1) {

GlobalVariableSet(g_var_name_748, 10.0);

return;

}

GlobalVariableSet(g_var_name_748, -10.0);

}

 

void SaveBuy1(double ad_0) {

GlobalVariableSet(g_var_name_756, ad_0);

}

 

void SaveSell1(double ad_0) {

GlobalVariableSet(g_var_name_764, ad_0);

}

 

void SaveMA10(double ad_0) {

GlobalVariableSet(g_var_name_772, ad_0);

}

 

void SaveMA21(double ad_0) {

GlobalVariableSet(g_var_name_780, ad_0);

}

 

void SaveMA50(double ad_0) {

GlobalVariableSet(g_var_name_788, ad_0);

}

 

void SavefAngle(double ad_0) {

GlobalVariableSet(g_var_name_796, ad_0);

}

 

void SaveTradeCandleOpenTime(int ai_0) {

GlobalVariableSet(g_var_name_804, ai_0);

}

 

void SaveLastTradeSignalTime(int ai_0) {

GlobalVariableSet(g_var_name_812, ai_0);

}

 

void SaveLastArrow(int ai_0) {

GlobalVariableSet(g_var_name_820, ai_0);

}

 

void SaveLastSmile(int ai_0) {

GlobalVariableSet(g_var_name_828, ai_0);

}

 

void SaveFib1(int ai_0) {

GlobalVariableSet(g_var_name_836, ai_0);

}

 

void SaveFib2(int ai_0) {

GlobalVariableSet(g_var_name_844, ai_0);

}

 

void SaveFib3(int ai_0) {

GlobalVariableSet(g_var_name_852, ai_0);

}

Share this post


Link to post
Share on other sites
Below is what I believe to be an open code for the Steinitz fractal breakout strategy. I would like to know if its possible to translate this into easylanguage for tradestation. Please let me know if this is going to work, thank you

...}

 

would you have a sample chart?

what does the indicator do?

 

 

ps: please wrap the code with the code tag. it is the # key at the top of the message window.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • there is no avoiding loses to be honest, its just how the market is. you win some and hopefully more, but u do lose some. 
    • Date: 11th July 2025.   Demand For Gold Rises As Trump Announces Tariffs!   Gold prices rose significantly throughout the week as investors took advantage of the 2.50% lower entry level. Investors also return to the safe-haven asset as the US trade policy continues to escalate. As a result, investors are taking a more dovish tone. The ‘risk-off’ appetite is also something which can be seen within the stock market. The NASDAQ on Thursday took a 0.90% dive within only 30 minutes.   Trade Tensions Escalate President Trump has been teasing with new tariffs throughout the week. However, the tariffs were confirmed on Thursday. A 35% tariff on Canadian imports starting August 1st, along with 50% tariffs on copper and goods from Brazil. Some experts are advising that Brazil has been specifically targeted due to its association with the BRICS.   However, the President has not directly associated the tariffs with BRICS yet. According to President Trump, Brazil is targeting US technology companies and carrying out a ‘witch hunt’against former Brazilian President Jair Bolsonaro, a close ally who is currently facing prosecution for allegedly attempting to overturn the 2022 Brazilian election.   Although Brazil is one of the largest and fastest-growing economies in the Americas, it is not the main concern for investors. Investors are more concerned about Tariffs on Canada. The White House said it will impose a 35% tariff on Canadian imports, effective August 1st, raised from the earlier 25% rate. This covers most goods, with exceptions under USMCA and exemptions for Canadian companies producing within the US.   It is also vital for investors to note that Canada is among the US;’s top 3 trading partners. The increase was justified by Trump citing issues like the trade deficit, Canada’s handling of fentanyl trafficking, and perceived unfair trade practices.   The President is also threatening new measures against the EU. These moves caused US and European stock futures to fall nearly 1%, while the Dollar rose and commodity prices saw small gains. However, the main benefactor was Silver and Gold, which are the two best-performing metals of the day.   How Will The Fed Impact Gold? The FOMC indicated that the number of members warming up to the idea of interest rate cuts is increasing. If the Fed takes a dovish tone, the price of Gold may further rise. In the meantime, the President pushing for a 3% rate cut sparked talk of a more dovish Fed nominee next year and raised worries about future inflation.   Meanwhile, jobless claims dropped for the fourth straight week, coming in better than expected and supporting the view that the labour market remains strong after last week’s solid payroll report. Markets still expect two rate cuts this year, but rate futures show most investors see no change at the next Fed meeting. Gold is expected to finish the week mostly flat.       Gold 15-Minute Chart     If the price of Gold increases above $3,337.50, buy signals are likely to materialise again. However, the price is currently retracing, meaning traders are likely to wait for regained momentum before entering further buy trades. According to HSBC, they expect an average price of $3,215 in 2025 (up from $3,015) and $3,125 in 2026, with projections showing a volatile range between $3,100 and $3,600   Key Takeaway Points: Gold Rises on Safe-Haven Demand. Gold gained as investors reacted to rising trade tensions and market volatility. Canada Tariffs Spark Concern. A 35% tariff on Canadian imports drew attention due to Canada’s key trade role. Fed Dovish Shift Supports Gold. Growing expectations of rate cuts and Trump’s push for a 3% cut boosted the gold outlook. Gold Eyes Breakout Above $3,337.5. Price is consolidating; a move above $3,337.50 could trigger new buy signals. Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report.   Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news.   Michalis Efthymiou HFMarkets   Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in Leveraged Products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • Back in the early 2000s, Netflix mailed DVDs to subscribers.   It wasn’t sexy—but it was smart. No late fees. No driving to Blockbuster.   People subscribed because they were lazy. Investors bought the stock because they realized everyone else is lazy too.   Those who saw the future in that red envelope? They could’ve caught a 10,000%+ move.   Another story…   Back in the mid-2000s, Amazon launched Prime.   It wasn’t flashy—but it was fast.   Free two-day shipping. No minimums. No hassle.   People subscribed because they were impatient. Investors bought the stock because they realized everyone hates waiting.   Those who saw the future in that speedy little yellow button? They could’ve caught another 10,000%+ move.   Finally…   Back in 2011, Bitcoin was trading under $10.   It wasn’t regulated—but it worked.   No bank. No middleman. Just wallet to wallet.   People used it to send money. Investors bought it because they saw the potential.   Those who saw something glimmering in that strange orange coin? They could’ve caught a 100,000%+ move.   The people who made those calls weren’t fortune tellers. They just noticed something simple before others did.   A better way. A quiet shift. A small edge. An asymmetric bet.   The red envelope fixed late fees. The yellow button fixed waiting. The orange coin gave billions a choice.   Of course, these types of gains are rare. And they happen only once in a blue moon. That’s exactly why it’s important to notice when the conditions start to look familiar.   Not after the move. Not once it's on CNBC. But in the quiet build-up— before the surface breaks.   Enter the Blue Button Please read more here: https://altucherconfidential.com/posts/netflix-amazon-bitcoin-blue  Profits from free accurate cryptos signals: https://www.predictmag.com/ 
    • What These Attacks Look Like There are several ways you could get hacked. And the threats compound by the day.   Here’s a quick rundown:   Phishing: Fake emails from your “bank.” Click the link, give your password—game over.   Ransomware: Malware that locks your files and demands crypto. Pay up, or it’s gone.   DDoS: Overwhelm a website with traffic until it crashes. Like 10,000 bots blocking the door. Often used by nations.   Man-in-the-Middle: Hackers intercept your messages on public WiFi and read or change them.   Social Engineering: Hackers pose as IT or drop infected USB drives labeled “Payroll.”   You don’t need to be “important” to be a target.   You just need to be online.   What You Can Do (Without Buying a Bunker) You don’t have to be tech-savvy.   You just need to stop being low-hanging fruit.   Here’s how:   Use a YubiKey (physical passkey device) or Authenticator app – Ditch text message 2FA. SIM swaps are real. Hackers often have people on the inside at telecom companies.   Use a password manager (with Yubikey) – One unique password per account. Stop using your dog’s name.   Update your devices – Those annoying updates patch real security holes. Use them.   Back up your files – If ransomware hits, you don’t want your important documents held hostage.   Avoid public WiFi for sensitive stuff – Or use a VPN.   Think before you click – Emails that feel “urgent” are often fake. Go to the websites manually for confirmation.   Consider Starlink in case the internet goes down – I think it’s time for me to make the leap. Don’t Panic. Prepare. (Then Invest.)   I spent an hour in that basement bar reading about cyberattacks—and watching real-world systems fall apart like dominos.   The internet going down used to be an inconvenience. Now, it’s a warning.   Cyberwar isn’t coming. It’s here.   And the next time your internet goes out, it might not just be your router.   Don’t panic. Prepare.   And maybe keep a backup plan in your back pocket. Like a local basement bar with good bourbon—and working WiFi.   As usual, we’re on the lookout for more opportunities in cybersecurity. Stay tuned.   Author: Chris Campbell (AltucherConfidential) Profits from free accurate cryptos signals: https://www.predictmag.com/   
    • DUMBSHELL:  re the automation of corruption ---  200,000 "Science Papers" in academic journal database PubMed may have been AI-generated with errors, hallucinations and false sourcing 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.