[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 146

 
Vovo4ka:


Guys help, I don't get it....
Entry to buy: When two RSI indicators with periods of 14 and 17 cross simultaneously and close above 30 upwards....

Entry to sell: When two RSI indicators with periods of 14 and 17 cross simultaneously and close below the level of 70 from above down....

Interested in simultaneous crossing of the bloodlines...i.e. EXAMPLE

diRSI1 and diRSI2 were both less than 30 and by the close of the next candle both were greater than 30... Similarly with level 70!


double diRSI1=iRSI(NULL,0,14,PRICE_CLOSE,0);
double diRSI2=iRSI(NULL,0,17,PRICE_CLOSE,0);
double diRSI3=iRSI(NULL,0,14,PRICE_CLOSE,1);
double diRSI4=iRSI(NULL,0,17,PRICE_CLOSE,1);

if(AccountFreeMargin()<(100*Lots)){
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
if (!ExistPositions()){

if(( diRSI1>30 && diRSI2>30 && diRSI3<30 && diRSI4<30)){
OpenBuy();
return(0);
}

if ((diRSI1<70 && diRSI2<70 && diRSI3>70 && diRSI4>70)){
OpenSell();
return(0);
}
}


if correct then on the test still opens trades that don't fit....

FELLAS HELP...

ObjectCreate("RSI1", OBJ_LABEL, 0, 0, 0);
ObjectSet("RSI1", OBJPROP_CORNER, 0);
ObjectSet("RSI1", OBJPROP_XDISTANCE, 5);
ObjectSet("RSI1", OBJPROP_YDISTANCE, 30);
ObjectSetText("RSI2","diRSI1" + DoubleToStr(diRSI1,1), 9, "Verdana", Yellow);

ObjectCreate("RSI2", OBJ_LABEL, 0, 0, 0);
ObjectSetText("RSI2", "diRSI2" + DoubleToStr(diRSI2,1), 9, "Verdana", Yellow);
ObjectSet("RSI2", OBJPROP_CORNER, 0);
ObjectSet("RSI2", OBJPROP_XDISTANCE, 5);
ObjectSet("RSI2", OBJPROP_YDISTANCE, 45);
      
ObjectCreate("RSI3", OBJ_LABEL, 0, 0, 0);
ObjectSetText("RSI3", "diRSI3" + DoubleToStr(diRSI3,1), 9, "Verdana", Yellow);
ObjectSet("RSI3", OBJPROP_CORNER, 0);
ObjectSet("RSI3", OBJPROP_XDISTANCE, 5);
ObjectSet("RSI3", OBJPROP_YDISTANCE, 60);
      
ObjectCreate("RSI4", OBJ_LABEL, 0, 0, 0);
ObjectSetText("RSI4", "diRSI4" + DoubleToStr(diRSI4,1), 9, "Verdana", Yellow);
ObjectSet("RSI4", OBJPROP_CORNER, 0);
ObjectSet("RSI4", OBJPROP_XDISTANCE, 5);
ObjectSet("RSI4", OBJPROP_YDISTANCE, 75);
paste this into your code and see how the numbers change on the screen, then you will understand what you need to do
 
todem:
paste this into your code and see how the numbers change on the screen, then you'll know what to put in


Thanks a lot, let's check it out))

One more question, if we didn't describe a variable, but didn't assign a value, it will automatically be assigned 0 ????

 

I seem to be having trouble dividing int...

can someone please explain what cannot be divided by what?

5 to 3 or int to double or double to int or both...

to execute double i=5/3; you have to make 5 into double...

 

Good day, dear forum members. :)

I am interested in the following point - how to make the chart in MetaTrader to be shifted on the screen more than 50% from the right edge?

Is there any constant or function that controls the offset?

I tried searching for it, but it did not show anything about the shift.

Does anyone have any information on the subject ? :)

Thanks in advance for your attention. :)

 
eddy:

I seem to be having trouble dividing the int...

Google search. Keywords division int double site:mql4.com
Very detailed description.
 

Question about the tester. Please help!

How do I make the default chart draw with my settings after a run in the tester, rather than the default black. I have already saved the default template with my settings. If I open a new chart for a tool, everything is fine, it opens as it should, but the tester keeps drawing a black template? I can't find the chart parameter file in the tester to replace it with my own, if it exists separately of course.

 
polsvv:

Question about the tester. Please help!

How do I make the default chart draw with my settings after a run in the tester, rather than the default black. I have already saved the default template with my settings. If I open a new chart for a tool, everything is fine, it opens as it should, but the tester keeps drawing a black template? I can't find the chart parameter file in the tester to replace it with my own, if it exists separately of course.

right-click - save template - tester.tpl
 
how do i know the colour of the indicator? if it is only given to the indicator buffer. by default #property indicator_color1 blue
 
eddy:
how do i know the colour of the indicator? if it is only given to the indicator buffer. by default #property indicator_color1 blue
is there any way to know the colour if it is not set to #property indicator_color1 ?
 
I mean it is only set to a buffer and not to an external variable