I need help with comments please
- How to code?
- Ask!
- EuroBlaster LOL
I have 4 ways to open a position in my expert ie long,long2, long3, long4. How can I add a comment to show me which entry criteria was used eg if a position was opened using long2 criteria then I would like a comment to show Long2 used
Print("Position 1 is: ", value1); Print("Position 2 is: ", value2); Print("Position 3 is: ", value3); Print("Position 4 is: ", value4); // or Print("Position 1 is: ", value1, " - Position 2 is: ", value2, " - Position 3 is: ", value3, " - Position 4 is: ", value4);
bool Long = MAofRSI11>MAofRSI21 && MAofRSI12<=MAofRSI22 && VolCH>VolHL && RSIndex1<HLM && RSIndex1>HL2 && TrStop<Close[shift] && MOM>0.0 && SDLL && ma<Close[shift];
bool Short = MAofRSI11<MAofRSI21 && MAofRSI12>=MAofRSI22 && VolCH>VolHL && RSIndex1<HL1 && RSIndex1>HLM && TrStop>Close[shift] && MOM<0.0 && SDLS && ma>Close[shift];
bool Long2 = MAofRSI11>HLM && MAofRSI12<=HLM && MAofRSI21>HLM && MAofRSI22<=HLM && VolCH>VolHL && TrStop<Close[shift] && MOM>0.0 && SDLL && ma<Close[shift];
bool Short2 = MAofRSI11<HLM && MAofRSI12>=HLM && MAofRSI21<HLM && MAofRSI22>=HLM && VolCH>VolHL && TrStop>Close[shift] && MOM<0.0 && SDLS && ma>Close[shift];
bool Long3 = RSIndex1-RSIndex2>20<HL2 && TrStop<Close[shift] && MOM>0.0 && SDLL && ma<Close[shift];
bool Short3 = RSIndex2-RSIndex1>20>HL1 && TrStop>Close[shift] && MOM<0.0 && SDLS && ma>Close[shift];
bool Long4 = zscore>0.0 && ma<Close[shift];
bool Short4 = zscore<0.0 && ma>Close[shift];
buysig = Long || Long2 || Long3 || Long4;
sellsig = Short || Short2 || Short3 || Short4;
closebuy=sellsig;
closesell=buysig;
if (curprof>=AccountBalance()*ProfitExit/100.0) {
exit=true;
}
if (last>0 && (Time[0]-last)/(Period()*60)>=CancelOrderBars) {
remorder=true;
}
}
void CheckForOpen() {
int res,tr;
//---- sell conditions
co=CalculateCurrentOrders(Symbol());
if(sellsig && lastsig!=-1) {
co=CalculateCurrentOrders(Symbol());
if (co==0) {
res = OpenStop(OP_SELLSTOP,LotsRisk(StopLoss), Low[shift]-OrderPipsDiff*Point, StopLoss, TakeProfit1);
Print("Position 1 is: ", Short, " - Position 2 is: ", Short2, " - Position 3 is: ", Short3, " - Position 4 is: ", Short4);
}
lastsig=-1;
last=Time[0];
return;
}
//---- buy conditions
if(buysig && lastsig!=1) {
co=CalculateCurrentOrders(Symbol());
if (co==0) {
res = OpenStop(OP_BUYSTOP,LotsRisk(StopLoss), High[shift]+OrderPipsDiff*Point, StopLoss, TakeProfit1);
Print("Position 1 is: ", Long, " - Position 2 is: ", Long2, " - Position 3 is: ", Long3, " - Position 4 is: ", Long4);
}
last=Time[0];
lastsig=1;
return;
}
}
Has anyone done this before if so could you please show me an example?
Any help would be great?
Thanks
You only gave part of the code. Here is part of an Answer.
"I have 4 ways to open a position in my expert..."
//+------------------------------------------------------------------+ //| euroform-exp.mq4 | //| Copyright © 2006, Nick Bilak, beluck[AT]gmail.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, Nick Bilak"
Whose expert?
We all have to start somewhere
"We all have to start somewhere"
That's true.
Looks like you are close to getting your comments into the journal. Do they work?
"We all have to start somewhere"
That's true.
Looks like you are close to getting your comments into the journal. Do they work?
"We all have to start somewhere"
That's true.
Looks like you are close to getting your comments into the journal. Do they work?
Any help would be great.