If we use "Set Profit target" or "Set Stop Loss", we are getting an error while generating the source code :
the TPL file are not working correctly :
// Move PT to if(sqSelectPosition(<@printMagicNumber block />, <@printSymbol block />, <@printParam block "#Direction#" />, <@printComment block />)) { <#if childWithKeyExists(block, "#ProfitTarget#") == true> sqSetSLPT(PositionGetInteger(POSITION_TICKET), 0, sqFixMarketPrice(<@printRangeLevelMethod block "#ProfitTarget#" "price" />, PositionGetString(POSITION_SYMBOL))); <#else> sqSetSLPT(PositionGetInteger(POSITION_TICKET), 0, sqFixMarketPrice(<@printRangeLevelMethod block "#ProfitTarget.ProfitTarget#" "price" />, PositionGetString(POSITION_SYMBOL))); </#if> }
// Move SL if(sqSelectPosition(<@printMagicNumber block />, <@printSymbol block />, <@printParam block "#Direction#" />, <@printComment block />)) { <#if childWithKeyExists(block, "#StopLoss#") == true> sqSetSLPT(PositionGetInteger(POSITION_TICKET), sqFixMarketPrice(<@printRangeLevelMethod block "#StopLoss#" "price" />, PositionGetString(POSITION_SYMBOL)), 0); <#else> sqSetSLPT(PositionGetInteger(POSITION_TICKET), sqFixMarketPrice(<@printRangeLevelMethod block "#StopLoss.StopLoss#" "price" />, PositionGetString(POSITION_SYMBOL)), 0); </#if> }
Please see attached video and test template
https://drive.proton.me/urls/JF13D8H6W0#Rke415djkvSs
Description changed:
If we use "Set Profit target" or "Set Stop Loss", we are getting an error while generating the source code :
the TPL file are not working correctly :
// Move PT to if(sqSelectPosition(<@printMagicNumber block />, <@printSymbol block />, <@printParam block "#Direction#" />, <@printComment block />)) { <#if childWithKeyExists(block, "#ProfitTarget#") == true> sqSetSLPT(PositionGetInteger(POSITION_TICKET), 0, sqFixMarketPrice(<@printRangeLevelMethod block "#ProfitTarget#" "price" />, PositionGetString(POSITION_SYMBOL))); <#else> sqSetSLPT(PositionGetInteger(POSITION_TICKET), 0, sqFixMarketPrice(<@printRangeLevelMethod block "#ProfitTarget.ProfitTarget#" "price" />, PositionGetString(POSITION_SYMBOL))); </#if> }
// Move SL if(sqSelectPosition(<@printMagicNumber block />, <@printSymbol block />, <@printParam block "#Direction#" />, <@printComment block />)) { <#if childWithKeyExists(block, "#StopLoss#") == true> sqSetSLPT(PositionGetInteger(POSITION_TICKET), sqFixMarketPrice(<@printRangeLevelMethod block "#StopLoss#" "price" />, PositionGetString(POSITION_SYMBOL)), 0); <#else> sqSetSLPT(PositionGetInteger(POSITION_TICKET), sqFixMarketPrice(<@printRangeLevelMethod block "#StopLoss.StopLoss#" "price" />, PositionGetString(POSITION_SYMBOL)), 0); </#if> }
Please see attached video and test template
https://drive.proton.me/urls/JF13D8H6W0#Rke415djkvSs
Status changed from New to Waiting for information
Attachment image-0.png added
I have noticed that you have sqx137 in the video.
Do you still have the same problem with sq138 or can we close the task?
If you still face the problem, please attach the problematic strategies from your databank + the template file.
Attachment image-0.png added
I tested it on Build 138.
it is working fine as well on my side now with Build 138.
Thank you for your answer and for your excellent work !!
Subject changed from Urgent : Set Profit Target, Set Stop Loss source code is not accessible to Solved : Set Profit Target, Set Stop Loss source code is not accessible
Subject changed from Solved : Set Profit Target, Set Stop Loss source code is not accessible to Fixed : Set Profit Target, Set Stop Loss source code is not accessible