I am trying to make an indicator in MQL4, which would plot a line on "US.500+" chart by close prices from "US.30+". In general, the price lines of two symbols would be visible on one chart. Below is the code, but it does not work. In the log message "indicator on custom buffer is not supported yet". Teach me why it doesn't work. Opps.
#property version"1.00"#property strict#property indicator_chart_window#property indicator_buffers1#property indicator_plots1#property indicator_color1clrRed#property indicator_style1STYLE_DOT#property indicator_type1DRAW_LINE//---inputstring symbolName="US.30+"; // Symbol nameinputdouble difference=-22387.0; // Difference from other symbol//--- price buffer for other symboldouble otherSymbol[];
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit()
{
//--- indicator buffers mappingSetIndexBuffer(0,otherSymbol,INDICATOR_DATA);
//---returnINIT_SUCCEEDED;
}
//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constint begin,
constdouble &price[])
{
//---for(int i=prev_calculated;i<rates_total;i++)
otherSymbol[i+1]=iClose(symbolName,PERIOD_CURRENT,i)+difference;
ArraySetAsSeries(otherSymbol,true);
//--- return value of prev_calculated for next callreturn(rates_total);
}
I am trying to make an indicator in MQL4, which would plot a line on "US.500+" chart by close prices from "US.30+". In general, the price lines of two symbols would be visible on one chart. Below is the code, but it does not work. In the log message "indicator on custom buffer is not supported yet". Teach me why it doesn't work. Opps.
lil_lil: If it is 300 instead of 60 seconds ... you need to write at 300 second intervals from the time the position was opened. How do you do that?
Have you tried my program? I don't really understand 300... If you set 300 instead of 60, is it true? If you tell me how to get profit from it, I'll try to understand it better!
Help with the EA, as always the problem is probably trivial, but I haven't solved the conundrum
Should open buy ifema>smma fromema or not reaching itpoint(same for sell). Should close the deal at the close of the bar-open a new bar. The next open in the same way, but with a condition above theopening price of the previous one, that islast_order_price.
But in the end it opens where it wants and closes. (At the beginning of the test it opens and immediately closes)
Help with the EA, as always the problem is probably trivial, but I haven't solved the conundrum
Should open buy ifema>smma fromema or not reaching itpoint(same for sell). Should close the deal at the close of the bar-open a new bar. The next open in the same way, but with a condition above theopening price of the previous one, that islast_order_price.
But in the end it opens where it wants and closes. (At the beginning of the test it opens and immediately closes)
How can I suggest? Save your code to the clipboard, write it in the Expert Advisor and run it in the strategy tester? Well, I will see that it opens and closes. So what? I may run it on a demo - today is Saturday, tomorrow is Sunday, the market is closed. Do you have to look at them with your eyes? Well, you have to keep in mind the values of all variables. There was earlier a method of debugging with a pencil and paper - try it. You can also put an Alert("Bid=", Bid, Fast+P=",Fast_Ema+point*_Point," ....) before all OrderSelect and OrderClose and set one day in the tester for example from February 19 to 20 and then after the test to open the log, make a copy, delete unnecessary lines and analyze. The MetaEditor also has a debugging feature. When you learn how to debug ... it will be great.
Spread, if set to current. Test End Date if billed as current. There could be many more reasons.
Fixed Spread, End Date 01.01.18
Fixed spread, End date 01.01.18
cost per point..... etc
try this weekend.
I am trying to make an indicator in MQL4, which would plot a line on "US.500+" chart by close prices from "US.30+". In general, the price lines of two symbols would be visible on one chart. Below is the code, but it does not work. In the log message "indicator on custom buffer is not supported yet". Teach me why it doesn't work. Opps.
I am trying to make an indicator in MQL4, which would plot a line on "US.500+" chart by close prices from "US.30+". In general, the price lines of two symbols would be visible on one chart. Below is the code, but it does not work. In the log message "indicator on custom buffer is not supported yet". Teach me why it doesn't work. Opps.
Because you have to use the first form of call.
I found the reason - 60 seconds should be counted out of a loop
Thank you, thank you for the clarification.
If instead of 60 seconds it will be 300.
Position opening times are different, you need to write 300 seconds apart from the position opening time.
How should I do it?
Have you tried my program? I don't really understand 300... If you set 300 instead of 60, is it true? If you tell me how to get profit from it, I'll try to understand it better!
Help with the EA, as always the problem is probably trivial, but I haven't solved the conundrum
Should open buy ifema>smma fromema or not reaching itpoint(same for sell). Should close the deal at the close of the bar-open a new bar. The next open in the same way, but with a condition above theopening price of the previous one, that islast_order_price.
But in the end it opens where it wants and closes. (At the beginning of the test it opens and immediately closes)
Help with the EA, as always the problem is probably trivial, but I haven't solved the conundrum
Should open buy ifema>smma fromema or not reaching itpoint(same for sell). Should close the deal at the close of the bar-open a new bar. The next open in the same way, but with a condition above theopening price of the previous one, that islast_order_price.
But in the end it opens where it wants and closes. (At the beginning of the test it opens and immediately closes)
Where does it have a button?
Can you tell me how to align text in CSpinEdit control from #include <Controls\SpinEdit.mqh> (text field with increment).
By default it's aligned to the left edge, but I want it to be aligned to the right.