Conversion code Harmonic Trading.lua pour PRT
Forums › ProRealTime forum Français › Support ProBuilder › Conversion code Harmonic Trading.lua pour PRT
- This topic has 4 replies, 2 voices, and was last updated 4 years ago by roncevaux68.
-
-
04/06/2020 at 4:07 PM #124899
Bonjour
Je cherche à transcrire ce code Harmonic Trading.lua de la plateforme de fxcm marketscope2.0 pour pouvoir l’utiliser sur PRT, est ce possible ?
Merci
Plus d’information sur cet indicateur :http://fxcodebase.com/code/viewtopic.php?f=17&t=4994
cordialement
04/06/2020 at 9:49 PM #124940bonsoir,
tu as déjà regarder sur le forum ?
tiens un lien
https://www.prorealcode.com/prorealtime-indicators/abcd-pattern-indicator/
04/07/2020 at 12:33 PM #125012bonjour
merci pour l’info
je l’avais bien vu car avant de poster ma demande j’avais chercher sur le site pendant une bonne partie du week end
mais c’est un des Harmonic Patterns – Bullish AB=CD
avec ce fichier coder en lua on peux détecter les figurer en “Bat”, “Gartley “, “Crab”, “Butterfly “, et aussi les Bullish AB=CD
voilà exemple ci joint.
cordialement
1 user thanked author for this post.
04/14/2020 at 7:18 PM #126148un coup de main personne ?
code123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647-- More information about this indicator can be found at:--+------------------------------------------------------------------+--| Copyright © 2018, Gehtsoft USA LLC |--| http://fxcodebase.com |--+------------------------------------------------------------------+--| Developed by : Mario Jemic |--| mario.jemic@gmail.com |--+------------------------------------------------------------------+--| Support our efforts by donating |--| Paypal: https://goo.gl/9Rj74e |--+------------------------------------------------------------------+--| Patreon : https://goo.gl/GdXWeN |--| BitCoin : 15VCJTLaz12Amr7adHSBtL9v8XomURo9RF |--| BitCoin Cash: 1BEtS465S3Su438Kc58h2sqvVvHK9Mijtg |--| Ethereum : 0x8C110cD61538fb6d7A2B47858F0c0AaBd663068D |--| LiteCoin : LLU8PSY2vsq7B9kRELLZQcKf5nJQrdeqwD |--+------------------------------------------------------------------+-- Indicator profile initialization routinefunction Init()indicator:name("Harmonic Pattern");indicator:description("");indicator:requiredSource(core.Bar);indicator:type(core.Indicator);indicator:setTag("group", "Swing");indicator.parameters:addGroup("Pattern Selector");indicator.parameters:addBoolean("Bat", "Bat", "", true);indicator.parameters:addBoolean("Gartley", "Gartley", "", true);indicator.parameters:addBoolean("Crab", "Crab", "", true);indicator.parameters:addBoolean("Butterfly", "Butterfly", "", true);indicator.parameters:addBoolean("ABCD", "AB=CD", "", true);indicator.parameters:addBoolean("Three Drives", "Drives", "", true);indicator.parameters:addDouble("Correction", "correction", "", 25,0,33);indicator.parameters:addGroup("Zig Zag Calculation");indicator.parameters:addInteger("Depth", "Depth", "", 12, 1, 10000);indicator.parameters:addInteger("Deviation", "Deviation", "", 5, 1, 1000);indicator.parameters:addInteger("Backstep", "Backstep", "", 3, 1, 10000);indicator.parameters:addGroup("Zig Zag Style");indicator.parameters:addColor("Zig_color","Zig Color", "", core.rgb(0, 255, 0));indicator.parameters:addColor("Zag_color", "Zag Color", "", core.rgb(255, 0, 0));indicator.parameters:addInteger("widthZigZag", "Line Width", "", 1, 1, 5);indicator.parameters:addInteger("styleZigZag", "Line Style", "", core.LINE_SOLID);indicator.parameters:setFlag("styleZigZag", core.FLAG_LEVEL_STYLE);indicator.parameters:addGroup("Price Target Lines Style");indicator.parameters:addColor("Ratio_color","Line Color", "", core.rgb(0, 0, 255));indicator.parameters:addInteger("style", "style", "style", core.LINE_DOT);indicator.parameters:setFlag("style", core.FLAG_LEVEL_STYLE);indicator.parameters:addInteger("width", "Line Width", "", 3, 1, 5);indicator.parameters:addInteger("Transparency", "Transparency", "", 40,0,100);indicator.parameters:addColor("Bull", "Color of Bull", "", core.rgb( 0, 255, 0));indicator.parameters:addColor("Bear", "Color of Bear", "", core.rgb( 255, 0, 0));indicator.parameters:addGroup("Line Selector");indicator.parameters:addBoolean("Show", "Show Price Targets", "", false);indicator.parameters:addBoolean("ShowZigZag", "Show Zig Zag Line", "", true);end-- Indicator instance initialization routine-- Processes indicator parameters and creates output streams-- Parameters blocklocal Depth;local Deviation;local Backstep;local Correction;local Selector={};--local correctionA,correctionB;local Bull, Bear;local first;local source = nil;-- Streams blocklocal ZigC;local ZagC;local out;local line_id=1;local label_id=1;local LAST={};local Show;local ShowZigZag;local A,B,C,D,X;local XA;local AB;local BC;local CD;local XB;local XD;local AC;local BD;local AD;local Transparency;local Up={};local Down={};local One={};local Two={};-- Routinefunction Prepare(nameOnly)Correction= instance.parameters.Correction;Correction= Correction/100;Selector["Bat"]= instance.parameters.Bat;Selector["Gartley"]= instance.parameters.Gartley;Selector["Crab"]= instance.parameters.Crab;Selector["Butterfly"]= instance.parameters.Butterfly;Selector["AB=CD"]= instance.parameters.ABCD;Selector["Drives"]= instance.parameters.Drives;Bull= instance.parameters.Bull;Bear= instance.parameters.Bear;Transparency= instance.parameters.Transparency;ShowZigZag= instance.parameters.ShowZigZag;Depth = instance.parameters.Depth;Deviation = instance.parameters.Deviation;Backstep = instance.parameters.Backstep;source = instance.source;Show = instance.parameters.Show;Transparency= 100-Transparency;local name = profile:id() .. "(" .. source:name() .. ", " .. Depth .. ", " .. Deviation .. ", " .. Backstep .. ")";instance:name(name);if (nameOnly) thenreturn;endZIGZAG = core.indicators:create("ZIGZAG", source, Depth, Deviation, Backstep );first = ZIGZAG.DATA:first();if ShowZigZag thenout = instance:addStream("out", core.Line, name, "Up", instance.parameters.Ratio_color, first);out:setWidth(instance.parameters.widthZigZag);out:setStyle(instance.parameters.styleZigZag);elseout = instance:addInternalStream (0, 0);endZigC = instance.parameters.Zig_color;ZagC = instance.parameters.Zag_color;Up["Bat"]=instance:addStream("UpBat", core.Line, name, "", instance.parameters.Zig_color, first);Down["Bat"] =instance:addStream("DownBat", core.Line, name, "", instance.parameters.Zig_color, first);instance:createChannelGroup("Group","Group" , Up["Bat"], Down["Bat"], Bull, Transparency);Up["Gartley"]=instance:addStream("UpGartley", core.Line, name, "", instance.parameters.Zig_color, first);Down["Gartley"] =instance:addStream("DownGartley", core.Line, name, "", instance.parameters.Zig_color, first);instance:createChannelGroup("Group","Group" , Up["Gartley"], Down["Gartley"], Bull, Transparency);Up["Crab"]=instance:addStream("UpCrab", core.Line, name, "", instance.parameters.Zig_color, first);Down["Crab"] =instance:addStream("DownCrab", core.Line, name, "", instance.parameters.Zig_color, first);instance:createChannelGroup("Group","Group" , Up["Crab"], Down["Crab"], Bull, Transparency);Up["Butterfly"]=instance:addStream("UpButterfly", core.Line, name, "", instance.parameters.Zig_color, first);Down["Butterfly"] =instance:addStream("DownButterfly", core.Line, name, "", instance.parameters.Zig_color, first);instance:createChannelGroup("Group","Group" , Up["Butterfly"], Down["Butterfly"], Bull, Transparency);One["AB=CD"]=instance:addStream("One", core.Line, name, "", instance.parameters.Zig_color, first);Two["AB=CD"]=instance:addStream("Two", core.Line, name, "", instance.parameters.Zig_color, first);Down["AB=CD"] =instance:addStream("DownABCD", core.Line, name, "", instance.parameters.Zig_color, first);instance:createChannelGroup("Group","Group" , One["AB=CD"], Down["AB=CD"], Bull, Transparency);instance:createChannelGroup("Group","Group" , Two["AB=CD"], out, Bull, Transparency);Up["Drives"]=instance:addStream("UpDrives", core.Line, name, "", instance.parameters.Zig_color, first);Down["Drives"] =instance:addStream("DownDrives", core.Line, name, "", instance.parameters.Zig_color, first);instance:createChannelGroup("Group","Group" , Up["Drives"], Down["Drives"], Bull, Transparency);line_id=1;label_id=1endfunction Update(period, mode)if period < first+5 thenreturn;endlocal i;ZIGZAG:update(mode);if ZIGZAG.DATA[period-3] ~= 0 thenout[period-3]= ZIGZAG.DATA[period-3];endif period < source:size()-1 thenreturn;endline_id=1;label_id=1;for i = 1 , period, 1 doUp[i]=nil;Down[i]=nil;if ShowZigZag thenif out[i] ~= nil thenif out[i] > out[i-1] thenout:setColor(i, ZigC);elseout:setColor(i, ZagC);endendendif i == 1 thenLAST["HighFour"] = nil;LAST["HighThree"] = nil;LAST["HighTwo"] = nil;LAST["HighOne"] = nil;LAST["LowFour"] = nil;LAST["LowThree"] = nil;LAST["LowTwo"] = nil;LAST["LowOne"] = nil;endif out[i] > source.high[i] - source:pipSize() *0.001 and out[i] < source.high[i] + source:pipSize() *0.001 then--if out[i] == source.high[i] thenLAST["HighFour"]=LAST["HighThree"];LAST["HighThree"]=LAST["HighTwo"];LAST["HighTwo"]=LAST["HighOne"];LAST["HighOne"]=i;if LAST["HighFour"] ~= nil thenLengt(false);endendif out[i] > source.low[i] - source:pipSize() *0.001 and out[i] < source.low[i] + source:pipSize() *0.001 thenLAST["LowFour"]=LAST["LowThree"];LAST["LowThree"]=LAST["LowTwo"];LAST["LowTwo"]=LAST["LowOne"];LAST["LowOne"]=i;if LAST["LowFour"] ~= nil thenLengt(true);endendendendfunction Lengt(FLAG)if LAST["LowFour"] == nil or LAST["HighFour"] == nil thenreturn;endif FLAG thenD= LAST["LowOne"];B= LAST["LowTwo"];X= LAST["LowThree"];C = LAST["HighOne"];A= LAST["HighTwo"];elseD= LAST["HighOne"];B= LAST["HighTwo"];X= LAST["HighThree"];C = LAST["LowOne"];A= LAST["LowTwo"];endXA= math.abs(out[X]- out[A]);AB= math.abs(out[A]- out[B]);BC= math.abs(out[B]- out[C]);CD= math.abs(out[C]- out[D]);XB= math.abs(out[X]- out[B]);XD= math.abs(out[X]- out[D]);BD= math.abs(out[B]- out[D]);AC= math.abs(out[A]- out[C]);AD= math.abs(out[A]- out[D]);local label = DECODE(FLAG);if label~= nil thenDRAW (label );endendfunction DRAW (label)local Color;if X== Aor A== Bor B== Cor C== Dthenreturn;endif label == "Bull Three Drives" or label == "Bear Three Drives" thenif Selector["Drives"] thenif out[X] < out[A] thenColor= Bull;drawline(D, out[D] + AD*1.272, D + (D-A), out[D] + AD*1.272, Color);drawline(D, out[D] + XA, D + (A-X), out[D] + XA, Color);elseColor= Bear;drawline(D, out[D] + AD*1.272, D + (D-A), out[D] + AD*1.272, Color);drawline(D, out[D] + XA, D + (A-X), out[D] + XA, Color);endcore.drawLine(Up["Drives"], core.range(X, B), out[X], X, out[B], B, Color);core.drawLine(Up["Drives"], core.range(B, D), out[B], B, out[D], D, Color);Up["Drives"]:setColor(X, Color);core.host:execute("drawLabel", label_id, source:date(X), math.max(out[X], out[A]), ""..label.."");label_id = label_id + 1;core.drawLine(Down["Drives"], core.range(X, A), out[X], X, out[A], A, Color);core.drawLine(Down["Drives"], core.range(A, B), out[A], A, out[B], B, Color);core.drawLine(Down["Drives"], core.range(B, C), out[B], B, out[C], C, Color);core.drawLine(Down["Drives"], core.range(C, D), out[C], C, out[D], D, Color);endelseif label == "Bull Bat" or label == "Bear Bat" thenif Selector["Bat"] thenif out[X] < out[A] thenColor= Bull;drawline(D, out[D] + AD*1.272, D + (D-A), out[D] + AD*1.272, Color);drawline(D, out[D] + XA, D + (A-X), out[D] + XA, Color);elseColor= Bear;drawline(D, out[D] - AD*1.272, D + (D-A), out[D] - AD*1.272, Color);drawline(D, out[D] - XA, D + (A-X), out[D]-XA, Color);endcore.drawLine(Up["Bat"], core.range(X, D), out[X], X, out[D], D, Color);Up["Bat"]:setColor(X, Color);core.host:execute("drawLabel", label_id, source:date(X), math.max(out[A], out[B]), ""..label.."");label_id = label_id + 1;core.drawLine(Down["Bat"], core.range(X, A), out[X], X, out[A], A, Color);core.drawLine(Down["Bat"], core.range(A, B), out[A], A, out[B], B, Color);core.drawLine(Down["Bat"], core.range(B, C), out[B], B, out[C], C, Color);core.drawLine(Down["Bat"], core.range(C, D), out[C], C, out[D], D, Color);endelseif label == "Bull Gartley" or label == "Bear Gartley" thenif Selector["Gartley"] thenif out[X] < out[A] thenColor= Bull;drawline(D, out[D] + AD*1.272, D + (D-A), out[D] + AD*1.272, Color);drawline(D, out[D] + XA, D + (A-X), out[D] + XA, Color);elseColor= Bear;drawline(D, out[D] - AD*1.272, D + (D-A), out[D] - AD*1.272, Color);drawline(D, out[D] - XA, D + (A-X), out[D] - XA, Color);endcore.drawLine(Up["Gartley"], core.range(X, D), out[X], X, out[D], D, Color);Up["Gartley"]:setColor(X, Color);core.host:execute("drawLabel", label_id, source:date(X), math.max(out[A], out[B]), ""..label.."");label_id = label_id + 1;core.drawLine(Down["Gartley"], core.range(X, A), out[X], X, out[A], A, Color);core.drawLine(Down["Gartley"], core.range(A, B), out[A], A, out[B], B, Color);core.drawLine(Down["Gartley"], core.range(B, C), out[B], B, out[C], C, Color);core.drawLine(Down["Gartley"], core.range(C, D), out[C], C, out[D], D, Color);endelseif label == "Bull Crab" or label == "Bear Crab" thenif Selector["Crab"] thenif out[X] < out[A] thenColor= Bull;drawline(D, out[D] + AD*1.272, D + (D-A), out[D] + AD*1.272, Color);drawline(D, out[D] + XA, D + (A-X), out[D] + XA, Color);elseColor= Bear;drawline(D, out[D] - AD*1.272, D + (D-A), out[D] - AD*1.272, Color);drawline(D, out[D] - XA, D + (A-X), out[D]- XA, Color);endcore.drawLine(Up["Crab"], core.range(X, D), out[X], X, out[D], D, Color);Up["Crab"]:setColor(X, Color);core.host:execute("drawLabel", label_id, source:date(X), math.max(out[A], out[B]), ""..label.."");label_id = label_id + 1;core.drawLine(Down["Crab"], core.range(X, A), out[X], X, out[A], A, Color);core.drawLine(Down["Crab"], core.range(A, B), out[A], A, out[B], B, Color);core.drawLine(Down["Crab"], core.range(B, C), out[B], B, out[C], C, Color);core.drawLine(Down["Crab"], core.range(C, D), out[C], C, out[D], D, Color);endelseif label == "Bull Butterfly" or label == "Bear Butterfly" thenif Selector["Butterfly"] thenif out[X] < out[A] thenColor= Bull;drawline(D, out[D] + AD*1.272, D + (D-A), out[D] + AD*1.272, Color);drawline(D, out[D] + XA, D + (A-X), out[D] + XA, Color);elseColor= Bear;drawline(D, out[D] - AD*1.272, D + (D-A), out[D] - AD*1.272, Color);drawline(D, out[D] - XA, D + (A-X), out[D] - XA, Color);endcore.drawLine(Up["Butterfly"], core.range(X, D), out[X], X, out[D], D, Color);Up["Butterfly"]:setColor(X, Color);core.host:execute("drawLabel", label_id, source:date(X), math.max(out[A], out[B]), ""..label.."");label_id = label_id + 1;core.drawLine(Down["Butterfly"], core.range(X, A), out[X], X, out[A], A, Color);core.drawLine(Down["Butterfly"], core.range(A, B), out[A], A, out[B], B, Color);core.drawLine(Down["Butterfly"], core.range(B, C), out[B], B, out[C], C, Color);core.drawLine(Down["Butterfly"], core.range(C, D), out[C], C, out[D], D, Color);endelseif label ~= "Bull AB=CD" or label ~= "Bear AB=CD" thenif Selector["AB=CD"] thenif out[A] > out[B] thenColor= Bull;drawline(D, out[D] + AB*1.272, D + (B-A), out[D] + AB*1.272, Color);drawline(D, out[D] + AD, D + (D-A), out[D] + AD, Color);elseColor= Bear;drawline(D, out[D] - AB*1.272, D + (B-A), out[D] - AB*1.272, Color);drawline(D, out[D] - AD, D + (D-A), out[D] - AD, Color);endcore.drawLine(One["AB=CD"], core.range(A, C), out[A], A, out[C], C, Color);core.drawLine(Two["AB=CD"], core.range(B, D), out[B], B, out[D], D, Color);One["AB=CD"]:setColor(X, Color);core.host:execute("drawLabel", label_id, source:date(X), math.max(out[X], out[A]), ""..label.."");label_id = label_id + 1;core.drawLine(Down["AB=CD"], core.range(X, A), out[X], X, out[A], A, Color);core.drawLine(Down["AB=CD"], core.range(A, B), out[A], A, out[B], B, Color);core.drawLine(Down["AB=CD"], core.range(B, C), out[B], B, out[C], C, Color);core.drawLine(Down["AB=CD"], core.range(C, D), out[C], C, out[D], D, Color);endendendfunction DECODE ( FLAG)if FLAG thenif (out[X] -(1.27 -Correction/3)*XA) >= out[B] and ( out[X] - (1.618+Correction/3) *XA) <= out[B]and (out[B] -(1.27-Correction/3) *XA) >= out[D] and ( out[B] - (1.618+Correction/3) *XA) <= out[D]thenreturn "Bull Three Drives";endif (out[A] -(0.618-Correction/3) *AB) >= out[C] and ( out[A] - (0.786+Correction/3) *AB) <= out[C]and (out[A] -(1.27-Correction/3) *AB) >= out[D] and ( out[A] - (1.618+Correction/3) *AB) <= out[D]thenreturn "Bull AB=CD";endif (out[A] -(0.382-Correction) *XA) >= out[B] and ( out[A] - (0.5+Correction) *XA) <= out[B]and (out[A] -( 0.382-Correction) *AB) >= out[C] and (out[A] -(0.886+Correction) *AB) <= out[C]and (out[A] + (1.618-Correction) *AB) >= out[D] and (out[A] + (2.618 +Correction)*AB) <= out[D]and (out[A] - (0.886 -Correction)*XA ) >= out[D] and (out[A] - (0.886 +Correction) *XA ) >= out[D]thenreturn "Bull Bat";endif (out[A] -(0.618 -Correction) *XA) >= out[B] and (out[A] -(0.618 +Correction) *XA)<= out[B]and (out[A] - (0.382-Correction) *AB) >= out[C] and (out[A] -(0.886+Correction) *AB) <= out[C]and (out[A] + (1.27-Correction) *AB) >= out[D] and (out[A] + (1.618+Correction) *AB) <= out[D]and (out[A] - (0.786 -Correction)*XA ) >= out[D] and (out[A] - (0.786 +Correction)*XA ) <= out[D]thenreturn "Bull Gartley";endif (out[A] - (0.382-Correction) *XA) >= out[B] and (out[A] - (0.618+Correction) *XA) <= out[B]and (out[A] - (0.382-Correction) *AB) >= out[C] and (out[A] - (0.886+Correction) *AB)<= out[C]and (out[A] - (2.24 -Correction)*AB) >= out[D] and (out[A] - (3.618+Correction) *AB) <= out[D]and (out[A] - ( 1.618 -Correction) *XA ) >= out[D] and (out[A] - (1.618 +Correction) *XA ) <= out[D]thenreturn "Bull Crab";endif (out[A] - (0.786 -Correction) *XA) >= out[B] and (out[A] - (0.786 +Correction) *XA)<= out[B]and (out[A] - (0.382-Correction) *AB) >= out[C] and (out[A] - (0.886 +Correction)*AB)<= out[C]and (out[A] - (1.618-Correction) *AB) >= out[D] and (out[A] - (2.618+Correction) *AB) <= out[D]and (out[A] - (1.27 -Correction)*XA ) >= out[D] and (out[A] - (1.618+Correction) *XA ) <= out[D]thenreturn "Bull Butterfly";endelseif not FLAG thenif (out[X] +(1.27 - Correction/3)*XA) <= out[B] and ( out[X] + (1.618+Correction/3) *XA) >= out[B]and (out[B] +(1.27 - Correction/3)*XA) <= out[D] and ( out[B] + (1.618+Correction/3) *XA) >= out[D]thenreturn "Bear Three Drives";endif (out[A] +(0.618 - Correction/3)*AB) <= out[C] and ( out[A] +( 0.786+Correction/3) *AB) >= out[C]and (out[A] +(1.27 - Correction/3)*AB) <= out[D] and ( out[A] + (1.618+Correction/3) *AB) >= out[D]thenreturn "Bear AB=CD";endif (out[A] +(0.382 - Correction)*XA) <= out[B] and ( out[A] + (0.5+Correction) *XA) >= out[B]and (out[A] + (0.382- Correction) *AB) <= out[C] and (out[A] +(0.886 +Correction)*AB) >= out[C]and (out[A] - (1.618 - Correction)*AB) <= out[D] and (out[A] - (2.618 +Correction)*AB) >= out[D]and (out[A] + (0.886 - Correction)*XA ) <= out[D] and (out[A] + (0.886 +Correction) *XA ) >= out[D]thenreturn "Bear Bat";endif (out[A] +(0.618 - Correction) *XA) <= out[B] and (out[A] +(0.618 + Correction) *XA)>= out[B]and (out[A] +(0.382 - Correction)*AB) <= out[C] and (out[A] +(0.886+Correction) *AB) >= out[C]and (out[A] - (1.27 - Correction)*AB) <= out[D] and (out[A] - (1.618+Correction) *AB) >= out[D]and (out[A] + (0.786 - Correction)*XA ) <= out[D] and (out[A] +( 0.786+ Correction) *XA ) >= out[D]thenreturn "Bear Gartley";end-- return "Bear Crab";if (out[A] +( 0.382- Correction) *XA) <= out[B] and (out[A] +( 0.618+Correction) *XA) >= out[B]and (out[A] + (0.382- Correction) *AB) <= out[C] and (out[A] + (0.886+Correction) *AB)>= out[C]and (out[A] + (2.24 - Correction)*AB) <= out[D] and (out[A] + (3.618+Correction) *AB) >= out[D]and (out[A] + (1.618- Correction) *XA ) <= out[D] and (out[A] + (1.618+ Correction) *XA ) >= out[D]thenreturn "Bear Crab";endif (out[A] + (0.786- Correction) *XA) <= out[B] and (out[A] + (0.786+ Correction) *XA) >= out[B]and (out[A] + (0.382- Correction) *AB) <= out[C] and (out[A] + (0.886 +Correction)*AB)>= out[C]and (out[A] + (1.618- Correction) *AB) <= out[D] and (out[A] + (2.618 +Correction)*AB) >= out[D]and (out[A] +( 1.27- Correction) *XA ) <= out[D] and (out[A] + (1.618 +Correction)*XA ) >= out[D]thenreturn "Bear Butterfly";endendreturn nil;endfunction drawline(x1, y1, x2, y2, color)if x1== nil or x2==nilor x1== 0 or x2==0or x1 >= source:size()-1 or x2 >= source:size()-1or x1 <= source:first() or x2 <= source:first()thenreturn;endif not Show thenreturn;endlocal date1 = source:date(x1);local date2 = source:date(x2);core.host:execute("drawLine", line_id, date1, y1, date2, y2, color, instance.parameters.style, instance.parameters.width);line_id=line_id+1;endfunction Distance (x1,y1,x2,y2)return math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));end11/12/2020 at 5:06 PM #150315personne pour me donner un coup de main …
-
AuthorPosts
Find exclusive trading pro-tools on