how to print a test statement on journal?

 

I am new to MQL4.

I am reading help available there at the bottom of the editor, but since there is no search function, i could not locate what I want.


"I am trying to print on journal the following of the following format: open,close,high,low."


But I do not know how to construct the print statement, please help

 

The Print command will print to the experts tab, not the journal.

Print(Open[0]," ",Close[0]," ",High[0]," ",Low[0]);

 

Phy,


I thank you, it is working.


But I I have fundamental question.



I did this:


Print(Open[0]," ",Close[0]," ",High[0]," ",Low[0]," ",Ask," ",Bid);



I got this:



AUDUSD,M5: 0.6753 0.6745 0.6762 0.6745 0.6748 0.6745



Am I right to say that BID = close[0] always & ASK = BID = close[0] + spread.



If so, if we place an order via this program, when we say BID the entry will be Closing+ slippage?

If so, if we place an order via this program, when we say ASK the entry will be Closing+ + spread +slippage?

 

Chart is "indicative"...

If you want Bid and Ask use Bid and Ask.

But yes, Close[0] == Bid.

Slippage may or may not occur. you tell your Dealer "i want this price but if you feel like it, screw me"

 
phy:

Chart is "indicative"...

If you want Bid and Ask use Bid and Ask.

But yes, Close[0] == Bid.

Slippage may or may not occur. you tell your Dealer "i want this price but if you feel like it, screw me"

phy thanks,



what I noted is when I run the code for daily, i get more then print out for one day, there should be only one right

 

Show your code.

 

I thank you for your hand.


also one more funny thing, when i comment //if(Close[0]==PriceLow) or //if(Close[0]==PriceHigh) the result is different.


I can't understand why so, technically it should not happen.


bool FlagFirstRun;
double PriceCurrentPointer;
double PriceLow;
double PriceHigh;
extern double TakeProfit = 50;
extern double Lots = 0.1;
extern double TrailingStop = 30;

//+------------------------------------------------------------------+
//| Start function |
//+------------------------------------------------------------------+
int start()
{
if(IsTradeAllowed()==false)
{
Print("Trading Turned OFF");
}
else
{
if(Bars<100)
{
Print("Bars < 100");
}
else
{
if(TakeProfit<10)
{
Print("TakeProfit < 10");
}
else
{
//to set initial values before working out
if (FlagFirstRun==0)
{
PriceCurrentPointer=Bid;
PriceLow=PriceCurrentPointer;
PriceHigh=PriceCurrentPointer;
FlagFirstRun=1;
}
else
{
//to find for the local low
PriceCurrentPointer=Bid;
if (PriceCurrentPointer<=PriceLow)
{
PriceLow=PriceCurrentPointer;
}
//to find for the local high
PriceCurrentPointer=Bid;
if (PriceCurrentPointer>=PriceHigh)
{
PriceHigh=PriceCurrentPointer;
}

}
//Print(Open[0]," ",Close[0]," ",High[0]," ",Low[0]," ",Ask," ",Bid);
//if(Close[0]==PriceHigh)
{
Print("L-",PriceLow,", H-",PriceHigh);
}
//if(Close[0]==PriceLow)
{
Print("L-",PriceLow,", H-",PriceHigh);
}
}
}
}
return(0);
}
//+------------------------------------------------------------------+

 

start() is executed every tick, no matter what timeframe the chart.

So, your PRINT could be executed every tick.

 

did you run on your pc, with and without the comment,

OK please notice this the rate at which the numbers get to limits they are different and I get 8 - 10 entry with for the same day (daily chart) but the close[0] is slightly for each entry (I do not process entry), I am using ODL trial.



after talking to you i did this



for(i=10;i>1;i--)
{
PriceTempStore[i]=PriceTempStore[i-1];
Print(i);
}
technically it should be printing from 10 to 2 per incoming tick.

K when the cycle starts not really, the numbers are not full set, but when it near middle of the run then it gives my full set till the end of cycle, my question is it printing onto journal problem or computing problem.



I see my prints on the journal tab of metatrader


please try thanks

 
I'm sorry, I don't see where you are going with all this.
 
phy:
I'm sorry, I don't see where you are going with all this.

I am learning to MQL, on this platform 3 days now, I am trying to learn the interfaces and the reaction of codes, so that I will be able to do some code with few conceptual errors in the future.


For this I am using history data, i load to expert adviser daily chart, and what i told you is what i experienced



did you did what I mentioned, pretty funny though

Reason: