Abstract Financial Chart With Line Graph And Bar Chart On ...

My home-made bar replay for MT4

I made a home-made bar replay for MT4 as an alternative to the tradingview bar replay. You can change timeframes and use objects easily. It just uses vertical lines to block the future candles. Then it adjusts the vertical lines when you change zoom or time frames to keep the "future" bars hidden.
I am not a professional coder so this is not as robust as something like Soft4fx or Forex Tester. But for me it gets the job done and is very convenient. Maybe you will find some benefit from it.

Here are the steps to use it:
1) copy the text from the code block
2) go to MT4 terminal and open Meta Editor (click icon or press F4)
3) go to File -> New -> Expert Advisor
4) put in a title and click Next, Next, Finish
5) Delete all text from new file and paste in text from code block
6) go back to MT4
7) Bring up Navigator (Ctrl+N if it's not already up)
8) go to expert advisors section and find what you titled it
9) open up a chart of the symbol you want to test
10) add the EA to this chart
11) specify colors and start time in inputs then press OK
12) use "S" key on your keyboard to advance 1 bar of current time frame
13) use tool bar buttons to change zoom and time frames, do objects, etc.
14) don't turn on auto scroll. if you do by accident, press "S" to return to simulation time.
15) click "buy" and "sell" buttons (white text, top center) to generate entry, TP and SL lines to track your trade
16) to cancel or close a trade, press "close order" then click the white entry line
17) drag and drop TP/SL lines to modify RR
18) click "End" to delete all objects and remove simulation from chart
19) to change simulation time, click "End", then add the simulator EA to your chart with a new start time
20) When you click "End", your own objects will be deleted too, so make sure you are done with them
21) keep track of your own trade results manually
22) use Tools-> History center to download new data if you need it. the simulator won't work on time frames if you don't have historical data going back that far, but it will work on time frames that you have the data for. If you have data but its not appearing, you might also need to increase max bars in chart in Tools->Options->Charts.
23) don't look at status bar if you are moused over hidden candles, or to avoid this you can hide the status bar.


Here is the code block.
//+------------------------------------------------------------------+ //| Bar Replay V2.mq4 | //| Copyright 2020, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2020, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict #define VK_A 0x41 #define VK_S 0x53 #define VK_X 0x58 #define VK_Z 0x5A #define VK_V 0x56 #define VK_C 0x43 #define VK_W 0x57 #define VK_E 0x45 double balance; string balance_as_string; int filehandle; int trade_ticket = 1; string objectname; string entry_line_name; string tp_line_name; string sl_line_name; string one_R_line_name; double distance; double entry_price; double tp_price; double sl_price; double one_R; double TP_distance; double gain_in_R; string direction; bool balance_file_exist; double new_balance; double sl_distance; string trade_number; double risk; double reward; string RR_string; int is_tp_or_sl_line=0; int click_to_cancel=0; input color foreground_color = clrWhite; input color background_color = clrBlack; input color bear_candle_color = clrRed; input color bull_candle_color = clrSpringGreen; input color current_price_line_color = clrGray; input string start_time = "2020.10.27 12:00"; input int vertical_margin = 100; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { Comment(""); ChartNavigate(0,CHART_BEGIN,0); BlankChart(); ChartSetInteger(0,CHART_SHIFT,true); ChartSetInteger(0,CHART_FOREGROUND,false); ChartSetInteger(0,CHART_AUTOSCROLL,false); ChartSetInteger(0,CHART_SCALEFIX,false); ChartSetInteger(0,CHART_SHOW_OBJECT_DESCR,true); if (ObjectFind(0,"First OnInit")<0){ CreateStorageHLine("First OnInit",1);} if (ObjectFind(0,"Simulation Time")<0){ CreateTestVLine("Simulation Time",StringToTime(start_time));} string vlinename; for (int i=0; i<=1000000; i++){ vlinename="VLine"+IntegerToString(i); ObjectDelete(vlinename); } HideBars(SimulationBarTime(),0); //HideBar(SimulationBarTime()); UnBlankChart(); LabelCreate("New Buy Button","Buy",0,38,foreground_color); LabelCreate("New Sell Button","Sell",0,41,foreground_color); LabelCreate("Cancel Order","Close Order",0,44,foreground_color); LabelCreate("Risk To Reward","RR",0,52,foreground_color); LabelCreate("End","End",0,35,foreground_color); ObjectMove(0,"First OnInit",0,0,0); //--- create timer EventSetTimer(60); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- destroy timer EventKillTimer(); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { if (id==CHARTEVENT_CHART_CHANGE){ int chartscale = ChartGetInteger(0,CHART_SCALE,0); int lastchartscale = ObjectGetDouble(0,"Last Chart Scale",OBJPROP_PRICE,0); if (chartscale!=lastchartscale){ int chartscale = ChartGetInteger(0,CHART_SCALE,0); ObjectMove(0,"Last Chart Scale",0,0,chartscale); OnInit(); }} if (id==CHARTEVENT_KEYDOWN){ if (lparam==VK_S){ IncreaseSimulationTime(); UnHideBar(SimulationPosition()); NavigateToSimulationPosition(); CreateHLine(0,"Current Price",Close[SimulationPosition()+1],current_price_line_color,1,0,true,false,false,"price"); SetChartMinMax(); }} if(id==CHARTEVENT_OBJECT_CLICK) { if(sparam=="New Sell Button") { distance = iATR(_Symbol,_Period,20,SimulationPosition()+1)/2; objectname = "Trade # "+IntegerToString(trade_ticket); CreateHLine(0,objectname,Close[SimulationPosition()+1],foreground_color,2,5,false,true,true,"Sell"); objectname = "TP for Trade # "+IntegerToString(trade_ticket); CreateHLine(0,objectname,Close[SimulationPosition()+1]-distance*2,clrAqua,2,5,false,true,true,"TP"); objectname = "SL for Trade # "+IntegerToString(trade_ticket); CreateHLine(0,objectname,Close[SimulationPosition()+1]+distance,clrRed,2,5,false,true,true,"SL"); trade_ticket+=1; } } if(id==CHARTEVENT_OBJECT_CLICK) { if(sparam=="New Buy Button") { distance = iATR(_Symbol,_Period,20,SimulationPosition()+1)/2; objectname = "Trade # "+IntegerToString(trade_ticket); CreateHLine(0,objectname,Close[SimulationPosition()+1],foreground_color,2,5,false,true,true,"Buy"); objectname = "TP for Trade # "+IntegerToString(trade_ticket); CreateHLine(0,objectname,Close[SimulationPosition()+1]+distance*2,clrAqua,2,5,false,true,true,"TP"); objectname = "SL for Trade # "+IntegerToString(trade_ticket); CreateHLine(0,objectname,Close[SimulationPosition()+1]-distance,clrRed,2,5,false,true,true,"SL"); trade_ticket+=1; } } if(id==CHARTEVENT_OBJECT_DRAG) { if(StringFind(sparam,"TP",0)==0) { is_tp_or_sl_line=1; } if(StringFind(sparam,"SL",0)==0) { is_tp_or_sl_line=1; } Comment(is_tp_or_sl_line); if(is_tp_or_sl_line==1) { trade_number = StringSubstr(sparam,7,9); entry_line_name = trade_number; tp_line_name = "TP for "+entry_line_name; sl_line_name = "SL for "+entry_line_name; entry_price = ObjectGetDouble(0,entry_line_name,OBJPROP_PRICE,0); tp_price = ObjectGetDouble(0,tp_line_name,OBJPROP_PRICE,0); sl_price = ObjectGetDouble(0,sl_line_name,OBJPROP_PRICE,0); sl_distance = MathAbs(entry_price-sl_price); TP_distance = MathAbs(entry_price-tp_price); reward = TP_distance/sl_distance; RR_string = "RR = 1 : "+DoubleToString(reward,2); ObjectSetString(0,"Risk To Reward",OBJPROP_TEXT,RR_string); is_tp_or_sl_line=0; } } if(id==CHARTEVENT_OBJECT_CLICK) { if(sparam=="Cancel Order") { click_to_cancel=1; Comment("please click the entry line of the order you wish to cancel."); } } if(id==CHARTEVENT_OBJECT_CLICK) { if(sparam!="Cancel Order") { if(click_to_cancel==1) { if(ObjectGetInteger(0,sparam,OBJPROP_TYPE,0)==OBJ_HLINE) { entry_line_name = sparam; tp_line_name = "TP for "+sparam; sl_line_name = "SL for "+sparam; ObjectDelete(0,entry_line_name); ObjectDelete(0,tp_line_name); ObjectDelete(0,sl_line_name); click_to_cancel=0; ObjectSetString(0,"Risk To Reward",OBJPROP_TEXT,"RR"); } } } } if (id==CHARTEVENT_OBJECT_CLICK){ if (sparam=="End"){ ObjectsDeleteAll(0,-1,-1); ExpertRemove(); }} } //+------------------------------------------------------------------+ void CreateStorageHLine(string name, double value){ ObjectDelete(name); ObjectCreate(0,name,OBJ_HLINE,0,0,value); ObjectSetInteger(0,name,OBJPROP_SELECTED,false); ObjectSetInteger(0,name,OBJPROP_SELECTABLE,false); ObjectSetInteger(0,name,OBJPROP_COLOR,clrNONE); ObjectSetInteger(0,name,OBJPROP_BACK,true); ObjectSetInteger(0,name,OBJPROP_ZORDER,0); } void CreateTestHLine(string name, double value){ ObjectDelete(name); ObjectCreate(0,name,OBJ_HLINE,0,0,value); ObjectSetInteger(0,name,OBJPROP_SELECTED,false); ObjectSetInteger(0,name,OBJPROP_SELECTABLE,false); ObjectSetInteger(0,name,OBJPROP_COLOR,clrWhite); ObjectSetInteger(0,name,OBJPROP_BACK,true); ObjectSetInteger(0,name,OBJPROP_ZORDER,0); } bool IsFirstOnInit(){ bool bbb=false; if (ObjectGetDouble(0,"First OnInit",OBJPROP_PRICE,0)==1){return true;} return bbb; } void CreateTestVLine(string name, datetime timevalue){ ObjectDelete(name); ObjectCreate(0,name,OBJ_VLINE,0,timevalue,0); ObjectSetInteger(0,name,OBJPROP_SELECTED,false); ObjectSetInteger(0,name,OBJPROP_SELECTABLE,false); ObjectSetInteger(0,name,OBJPROP_COLOR,clrNONE); ObjectSetInteger(0,name,OBJPROP_BACK,false); ObjectSetInteger(0,name,OBJPROP_ZORDER,3); } datetime SimulationTime(){ return ObjectGetInteger(0,"Simulation Time",OBJPROP_TIME,0); } int SimulationPosition(){ return iBarShift(_Symbol,_Period,SimulationTime(),false); } datetime SimulationBarTime(){ return Time[SimulationPosition()]; } void IncreaseSimulationTime(){ ObjectMove(0,"Simulation Time",0,Time[SimulationPosition()-1],0); } void NavigateToSimulationPosition(){ ChartNavigate(0,CHART_END,-1*SimulationPosition()+15); } void NotifyNotEnoughHistoricalData(){ BlankChart(); Comment("Sorry, but there is not enough historical data to load this time frame."+"\n"+ "Please load more historical data or use a higher time frame. Thank you :)");} void UnHideBar(int barindex){ ObjectDelete(0,"VLine"+IntegerToString(barindex+1)); } void BlankChart(){ ChartSetInteger(0,CHART_COLOR_FOREGROUND,clrNONE); ChartSetInteger(0,CHART_COLOR_CANDLE_BEAR,clrNONE); ChartSetInteger(0,CHART_COLOR_CANDLE_BULL,clrNONE); ChartSetInteger(0,CHART_COLOR_CHART_DOWN,clrNONE); ChartSetInteger(0,CHART_COLOR_CHART_UP,clrNONE); ChartSetInteger(0,CHART_COLOR_CHART_LINE,clrNONE); ChartSetInteger(0,CHART_COLOR_GRID,clrNONE); ChartSetInteger(0,CHART_COLOR_ASK,clrNONE); ChartSetInteger(0,CHART_COLOR_BID,clrNONE);} void UnBlankChart(){ ChartSetInteger(0,CHART_COLOR_FOREGROUND,foreground_color); ChartSetInteger(0,CHART_COLOR_CANDLE_BEAR,bear_candle_color); ChartSetInteger(0,CHART_COLOR_CANDLE_BULL,bull_candle_color); ChartSetInteger(0,CHART_COLOR_BACKGROUND,background_color); ChartSetInteger(0,CHART_COLOR_CHART_DOWN,foreground_color); ChartSetInteger(0,CHART_COLOR_CHART_UP,foreground_color); ChartSetInteger(0,CHART_COLOR_CHART_LINE,foreground_color); ChartSetInteger(0,CHART_COLOR_GRID,clrNONE); ChartSetInteger(0,CHART_COLOR_ASK,clrNONE); ChartSetInteger(0,CHART_COLOR_BID,clrNONE);} void HideBars(datetime starttime, int shift){ int startbarindex = iBarShift(_Symbol,_Period,starttime,false); ChartNavigate(0,CHART_BEGIN,0); if (Time[WindowFirstVisibleBar()]>SimulationTime()){NotifyNotEnoughHistoricalData();} if (Time[WindowFirstVisibleBar()]=0; i--){ vlinename="VLine"+IntegerToString(i); ObjectCreate(0,vlinename,OBJ_VLINE,0,Time[i],0); ObjectSetInteger(0,vlinename,OBJPROP_COLOR,background_color); ObjectSetInteger(0,vlinename,OBJPROP_BACK,false); ObjectSetInteger(0,vlinename,OBJPROP_WIDTH,vlinewidth); ObjectSetInteger(0,vlinename,OBJPROP_ZORDER,10); ObjectSetInteger(0,vlinename,OBJPROP_FILL,true); ObjectSetInteger(0,vlinename,OBJPROP_STYLE,STYLE_SOLID); ObjectSetInteger(0,vlinename,OBJPROP_SELECTED,false); ObjectSetInteger(0,vlinename,OBJPROP_SELECTABLE,false); } NavigateToSimulationPosition(); SetChartMinMax();} }//end of HideBars function void SetChartMinMax(){ int firstbar = WindowFirstVisibleBar(); int lastbar = SimulationPosition(); int lastbarwhenscrolled = WindowFirstVisibleBar()-WindowBarsPerChart(); if (lastbarwhenscrolled>lastbar){lastbar=lastbarwhenscrolled;} double highest = High[iHighest(_Symbol,_Period,MODE_HIGH,firstbar-lastbar,lastbar)]; double lowest = Low[iLowest(_Symbol,_Period,MODE_LOW,firstbar-lastbar,lastbar)]; ChartSetInteger(0,CHART_SCALEFIX,true); ChartSetDouble(0,CHART_FIXED_MAX,highest+vertical_margin*_Point); ChartSetDouble(0,CHART_FIXED_MIN,lowest-vertical_margin*_Point); } void LabelCreate(string labelname, string labeltext, int row, int column, color labelcolor){ int ylocation = row*18; int xlocation = column*10; ObjectCreate(0,labelname,OBJ_LABEL,0,0,0); ObjectSetString(0,labelname,OBJPROP_TEXT,labeltext); ObjectSetInteger(0,labelname,OBJPROP_COLOR,labelcolor); ObjectSetInteger(0,labelname,OBJPROP_FONTSIZE,10); ObjectSetInteger(0,labelname,OBJPROP_ZORDER,10); ObjectSetInteger(0,labelname,OBJPROP_BACK,false); ObjectSetInteger(0,labelname,OBJPROP_CORNER,CORNER_LEFT_UPPER); ObjectSetInteger(0,labelname,OBJPROP_ANCHOR,ANCHOR_LEFT_UPPER); ObjectSetInteger(0,labelname,OBJPROP_XDISTANCE,xlocation); ObjectSetInteger(0,labelname,OBJPROP_YDISTANCE,ylocation);} double GetHLinePrice(string name){ return ObjectGetDouble(0,name,OBJPROP_PRICE,0); } void CreateHLine(int chartid, string objectnamey, double objectprice, color linecolor, int width, int zorder, bool back, bool selected, bool selectable, string descriptionn) { ObjectDelete(chartid,objectnamey); ObjectCreate(chartid,objectnamey,OBJ_HLINE,0,0,objectprice); ObjectSetString(chartid,objectnamey,OBJPROP_TEXT,objectprice); ObjectSetInteger(chartid,objectnamey,OBJPROP_COLOR,linecolor); ObjectSetInteger(chartid,objectnamey,OBJPROP_WIDTH,width); ObjectSetInteger(chartid,objectnamey,OBJPROP_ZORDER,zorder); ObjectSetInteger(chartid,objectnamey,OBJPROP_BACK,back); ObjectSetInteger(chartid,objectnamey,OBJPROP_SELECTED,selected); ObjectSetInteger(chartid,objectnamey,OBJPROP_SELECTABLE,selectable); ObjectSetString(0,objectnamey,OBJPROP_TEXT,descriptionn); } //end of code 
submitted by Learning_2 to Forex [link] [comments]

How to Fix a Not Responding MT4 Platform - YouTube How to Place Orders on MetaTrader 5 - YouTube Basic tutorial of the Forex MetaTrader 4 Platform (Part 1 ... BITCOIN FORCING $13,800 ? - PRICE PREDICTION Today News Thinkorswim Flexible Grid Chart Setup For Easy Technical ... BITCOIN CHART LIVESTREAM - Wird die 7100$ Marke halten?! Youtube Alternativen wie DTube im Talk Crypto Markets Look Upward as Bitcoin Flirts Bullish! Coinbase, Visa, Nasdaq and Telegram!

The chart we've created in this example shows Apple since early June. It also shows each Bearish Engulfing candle and Doji denoted by the red and gray label markers. Apple is up more than 50% year-to-date. However, most recently, a massive Bearish Engulfing candle occurred. We've highlight that area on the chart with an arrow. #134155633 - Mosaic forex market chart icon and rectangular stamps. Flat vector.. Vector. Similar Images . Add to Likebox ... #88581299 - Euro Forex Market icon. Flat gray iconic symbol in a light blue.. Vector. Similar Images . Add to Likebox #119711372 - SELL - technology and business concept . Similar Images . Add to Likebox #107019514 - financial report document yen euro dollar foreign ... Gray finance background. Forex chart diagram on white background. Forex chart diagram. Candlestick chart. Japanese candlestick chart. Reports and Diagrams Icons Set. Bitcoin trade logo template. Bitcoin stock market vector design. Bitcoin symbol and trading candlestick logotype . Stock, market, forex, currency exchange. Set of business doodle elements. Forex market hand drawn illustration ... Image detail for Charts Diagrams And Graphs Flat Icons Stock Illustration: Title: Charts Diagrams And Graphs Flat Icons Stock Illustration Date: August 10, 2020 Size: 68kB Resolution: 1000px x 1080px More Galleries of Charts Diagrams And Graphs Flat Icons Stock Illustration I loaded a robot program in folder expert and seems all ok but on the left below the folder where are the colored icon of expert my expert is gray! and i belive that in so way it is doesen't wokìrk.Where do i make the mistake? please helpme. Armydas . Big changes for MT4, in a few weeks; EA grayed out; DELETING UNREQUIRED CUSTOM INDICATORS; 6740. Tjipke de Vries 2013.03.01 16:11 #1 . armyda ... Forex Araliprofetia has a gray icon because its source code is not open (robot is protected). You will need any open M15 chart to start trading. You can either use an existing chart or open a new one, but be sure to set the M15 time frame by clicking the "M15" button in MetaTrader 4. Right-click on the Forex Rail Protocol icon and drag it onto ... Illustration about Abstract financial chart with line graph and bar chart on white gradient blue color. Illustration of fund, forex, graph - 114225493 The best selection of Royalty Free Forex Pattern Vector Art, Graphics and Stock Illustrations. Download 640+ Royalty Free Forex Pattern Vector Images. basic question about grey expert icons Platform Tech The best selection of Royalty Free Chart Forex Vector Art, Graphics and Stock Illustrations. Download 2,700+ Royalty Free Chart Forex Vector Images.

[index] [694] [29685] [1567] [12642] [6939] [4793] [23798] [19163] [17205] [4592]

How to Fix a Not Responding MT4 Platform - YouTube

📈Squeeze Pro Discount: http://bit.ly/SqueezeProI forgot to mention if you want to save your grid setup in the top right where you have the grid settings there ... http://www.exforexbroker.com/ & http://www.tallinex.com/?i=127767 I am a full time trader and a former commodities / stock broker / Forex Broker from the US.... BITCOIN CHART LIVESTREAM - Wird die 7100$ Marke halten?! Youtube Alternativen wie DTube im Talk Youtube Alternativen wie DTube im Talk Finanzielle Freiheit dank Kryptowährungen Place orders on MetaTrader 5. Learn some awesome quick tips and extra secrets of the MT5 platform with our MetaTrader 5 place order guide.Free MetaTrader 5 Guid... -Forex Markets: EUR, USD, JPY, NZD, CHF, AUS, CHN -Coinbase Card Live in Six European Countries-Why it's important to put purchasing power with crypto in adopters hands.-Russian Oil giant will ... Bitcoin Technical Analysis Price Today Join my Royal Coaching Program: http://scrembocoaching.com/ Collaboration: https://goo.gl/forms/9r50y5JdN08vITDo2 ICO ... Is your trading software giving you a Not Responding message? This short video will help you fix your MT4 platform when it's not responding. We will walk you...

http://binary-optiontrade.anbloomtoogeridd.tk